Initialize local project and fix ranch growth synchronization
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
package net.pixvi.myr.element.team
|
||||
{
|
||||
import net.pixvi.myr.center.MonsterCenter;
|
||||
import net.pixvi.myr.element.mon.MonsterVo;
|
||||
|
||||
public class TeamPositionVo
|
||||
{
|
||||
|
||||
public var position:int = 0;
|
||||
|
||||
public var team:TeamVo;
|
||||
|
||||
public function TeamPositionVo()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function get unlockLevel() : int
|
||||
{
|
||||
return team.positionUnlockLevel(position);
|
||||
}
|
||||
|
||||
public function get monster() : MonsterVo
|
||||
{
|
||||
if(team.monsters[position] > 0)
|
||||
{
|
||||
return MonsterCenter.getIns().getMonById(team.monsters[position]);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function get monsterId() : int
|
||||
{
|
||||
return team.monsters[position];
|
||||
}
|
||||
|
||||
public function get hasMonster() : Boolean
|
||||
{
|
||||
return team.monsters[position] > 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package net.pixvi.myr.element.team
|
||||
{
|
||||
public class TeamType
|
||||
{
|
||||
|
||||
public static const BATTLE_TEAM:String = "battleTeam";
|
||||
|
||||
public static const PVE_TEAM:String = "pveBattleTeam";
|
||||
|
||||
public function TeamType()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
package net.pixvi.myr.element.team
|
||||
{
|
||||
import net.pixvi.myr.center.Master;
|
||||
import net.pixvi.myr.center.Table;
|
||||
|
||||
public class TeamVo
|
||||
{
|
||||
|
||||
public var teamName:String = "teamA";
|
||||
|
||||
public var teamType:String = "battleTeam";
|
||||
|
||||
public var monsters:Array;
|
||||
|
||||
public function TeamVo()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function setMon(monId:Number, position:int) : void
|
||||
{
|
||||
monsters[position - 1] = monId;
|
||||
}
|
||||
|
||||
public function setEmpty(position:int) : void
|
||||
{
|
||||
monsters[position - 1] = 0;
|
||||
}
|
||||
|
||||
public function hasMon(position:int) : Boolean
|
||||
{
|
||||
return monsters[position - 1] == 0;
|
||||
}
|
||||
|
||||
public function hasEmpty() : int
|
||||
{
|
||||
var i:int = 0;
|
||||
var em:int = 0;
|
||||
for(i = 0; i < monsters.length; )
|
||||
{
|
||||
if(Table.team_info.battleTeam[i] != null && Table.team_info.battleTeam[i].level <= Master.level)
|
||||
{
|
||||
if(!monsters[i] > 0)
|
||||
{
|
||||
em++;
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return em;
|
||||
}
|
||||
|
||||
public function positionUnlockLevel(position:int) : int
|
||||
{
|
||||
return Table.team_info.battleTeam[position].level;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user