Initialize local project and fix ranch growth synchronization
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
package net.pixvi.myr.element.room
|
||||
{
|
||||
public class RoomOpenType
|
||||
{
|
||||
|
||||
public static const MONEY:int = 1;
|
||||
|
||||
public static const KE:int = 2;
|
||||
|
||||
public static const FREE:int = 3;
|
||||
|
||||
public function RoomOpenType()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,164 @@
|
||||
package net.pixvi.myr.element.room
|
||||
{
|
||||
import flash.display.MovieClip;
|
||||
import net.pixvi.common.utils.PiObject;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.myr.center.Master;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.element.mon.MonsterVo;
|
||||
import net.pixvi.myr.panel.build.BuildVo;
|
||||
import net.pixvi.pfw.utils.ArrayUtil;
|
||||
|
||||
public class RoomVo extends PiObject
|
||||
{
|
||||
|
||||
public var id:int = 0;
|
||||
|
||||
public var type:int = 0;
|
||||
|
||||
public var name:String = "";
|
||||
|
||||
public var data:Object;
|
||||
|
||||
public var openType:int;
|
||||
|
||||
public var sort:int = -1;
|
||||
|
||||
public function RoomVo()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function getImgSrcByType(type:int) : String
|
||||
{
|
||||
return "data/img/room/room_bg_" + type + ".png";
|
||||
}
|
||||
|
||||
public static function getNameSrcByType(type:int) : String
|
||||
{
|
||||
return "data/img/room/room_font_" + type + ".png";
|
||||
}
|
||||
|
||||
public function get position() : int
|
||||
{
|
||||
return Master.rooms.indexOf(this);
|
||||
}
|
||||
|
||||
public function get maxNum() : int
|
||||
{
|
||||
return table().maxNum;
|
||||
}
|
||||
|
||||
public function get isSpRoom() : Boolean
|
||||
{
|
||||
return table().spRoom;
|
||||
}
|
||||
|
||||
public function get curNum() : int
|
||||
{
|
||||
return getMonsterVoArr().length;
|
||||
}
|
||||
|
||||
public function get view() : Object
|
||||
{
|
||||
return table().view;
|
||||
}
|
||||
|
||||
public function get curEmptyNum() : int
|
||||
{
|
||||
return maxNum - curNum;
|
||||
}
|
||||
|
||||
public function get para() : Object
|
||||
{
|
||||
return table().para;
|
||||
}
|
||||
|
||||
public function get star() : int
|
||||
{
|
||||
return table().star;
|
||||
}
|
||||
|
||||
public function get element() : int
|
||||
{
|
||||
return table().element;
|
||||
}
|
||||
|
||||
public function table() : Object
|
||||
{
|
||||
return Table.room_info[type];
|
||||
}
|
||||
|
||||
public function get autoName() : String
|
||||
{
|
||||
return table().name;
|
||||
}
|
||||
|
||||
public function getImgSrc() : String
|
||||
{
|
||||
return getImgSrcByType(type);
|
||||
}
|
||||
|
||||
public function getNameSrc() : String
|
||||
{
|
||||
return getNameSrcByType(type);
|
||||
}
|
||||
|
||||
public function getGroundUI() : MovieClip
|
||||
{
|
||||
return FF.getMC("ui.GroundUI" + type);
|
||||
}
|
||||
|
||||
public function maxBuildNum() : int
|
||||
{
|
||||
return table().buildNum;
|
||||
}
|
||||
|
||||
public function curBuildNum() : int
|
||||
{
|
||||
return getBuildVoArr.length;
|
||||
}
|
||||
|
||||
public function getMonsterVoArr() : Array
|
||||
{
|
||||
var arr:Array = [];
|
||||
for each(var m:MonsterVo in Master.monsters)
|
||||
{
|
||||
if(m.roomId == id)
|
||||
{
|
||||
arr.push(m);
|
||||
}
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
||||
public function getBuildVoArr() : Array
|
||||
{
|
||||
var arr:Array = [];
|
||||
for each(var b:BuildVo in Master.builds)
|
||||
{
|
||||
if(b.roomId == id)
|
||||
{
|
||||
arr.push(b);
|
||||
}
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
||||
public function hasMon(mid:Number) : Boolean
|
||||
{
|
||||
var mons:Array = getMonsterVoArr();
|
||||
if(ArrayUtil.getElementByValue(mons,"id",mid) != null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getPosition() : int
|
||||
{
|
||||
return sort + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user