Initialize local project and fix ranch growth synchronization
This commit is contained in:
@@ -0,0 +1,79 @@
|
||||
package net.pixvi.myr.element.cost
|
||||
{
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.myr.element.bag.ItemVo;
|
||||
import net.pixvi.myr.element.reward.RewardType;
|
||||
|
||||
public class CostShowVo
|
||||
{
|
||||
|
||||
public var type:String = "";
|
||||
|
||||
public var typeId:int;
|
||||
|
||||
public var num:int = 1;
|
||||
|
||||
public function CostShowVo()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function get quality() : int
|
||||
{
|
||||
if(type == CostType.KE || type == CostType.MONEY || type == CostType.TI)
|
||||
{
|
||||
return RewardType.qualityDic[type];
|
||||
}
|
||||
if(type == "item")
|
||||
{
|
||||
return ItemVo.getQuality(typeId);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
public function get imgSrc() : String
|
||||
{
|
||||
if(type == CostType.KE || type == CostType.MONEY || type == CostType.TI)
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case RewardType.MONEY:
|
||||
return "data/img/item/item_money.png";
|
||||
case RewardType.KE:
|
||||
return "data/img/item/item_ke.png";
|
||||
case RewardType.TI:
|
||||
return "data/img/item/item_ti.png";
|
||||
}
|
||||
}
|
||||
else if(type == "item")
|
||||
{
|
||||
return ItemVo.getImgSrc(typeId);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public function get name() : String
|
||||
{
|
||||
if(type == CostType.KE || type == CostType.MONEY || type == CostType.TI)
|
||||
{
|
||||
return RewardType.nameDic[type];
|
||||
}
|
||||
if(type == "item")
|
||||
{
|
||||
return ItemVo.getName(typeId);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public function get tip() : String
|
||||
{
|
||||
var tip:String = name;
|
||||
if(type == "item" && ItemVo.getFrom(typeId) != null)
|
||||
{
|
||||
tip += "<br/>" + lang("获取途径:") + ItemVo.getFrom(typeId);
|
||||
}
|
||||
return tip;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package net.pixvi.myr.element.cost
|
||||
{
|
||||
public class CostType
|
||||
{
|
||||
|
||||
public static var MONEY:String = "money";
|
||||
|
||||
public static const MONSTER:String = "monster";
|
||||
|
||||
public static const ITEM:String = "item";
|
||||
|
||||
public static var KE:String = "ke";
|
||||
|
||||
public static var TI:String = "ti";
|
||||
|
||||
public function CostType()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
package net.pixvi.myr.element.cost
|
||||
{
|
||||
import net.pixvi.myr.element.reward.RewardType;
|
||||
import net.pixvi.pfw.utils.Mapper;
|
||||
|
||||
public class CostVo
|
||||
{
|
||||
|
||||
public var money:int = 0;
|
||||
|
||||
public var ke:int = 0;
|
||||
|
||||
public var ti:int = 0;
|
||||
|
||||
public var items:Array = [];
|
||||
|
||||
public var monsters:Array = [];
|
||||
|
||||
public function CostVo()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function setByVo(datavo:Object) : void
|
||||
{
|
||||
Mapper.fillVariables(this,datavo);
|
||||
}
|
||||
|
||||
public function getShowArray(showMoney:Boolean = false, showKe:Boolean = false, showTi:Boolean = false, exceptItemType:String = null) : Array
|
||||
{
|
||||
var showvo1:CostShowVo = null;
|
||||
var showvo2:CostShowVo = null;
|
||||
var showvo3:CostShowVo = null;
|
||||
var i:int = 0;
|
||||
var showvo:CostShowVo = null;
|
||||
var array:Array = [];
|
||||
if(showMoney && money > 0)
|
||||
{
|
||||
showvo1 = new CostShowVo();
|
||||
showvo1.type = RewardType.MONEY;
|
||||
showvo1.num = money;
|
||||
array.push(showvo1);
|
||||
}
|
||||
if(showKe && ke > 0)
|
||||
{
|
||||
showvo2 = new CostShowVo();
|
||||
showvo2.type = RewardType.KE;
|
||||
showvo2.num = ke;
|
||||
array.push(showvo2);
|
||||
}
|
||||
if(showTi && ti > 0)
|
||||
{
|
||||
showvo3 = new CostShowVo();
|
||||
showvo3.type = RewardType.TI;
|
||||
showvo3.num = ti;
|
||||
array.push(showvo3);
|
||||
}
|
||||
for(i = 0; i < items.length; )
|
||||
{
|
||||
if(!(exceptItemType != null && exceptItemType == items[i].typeId.toString()))
|
||||
{
|
||||
showvo = new CostShowVo();
|
||||
showvo.type = "item";
|
||||
showvo.num = items[i].num;
|
||||
showvo.typeId = items[i].typeId;
|
||||
array.push(showvo);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return array;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user