Initialize local project and fix ranch growth synchronization
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
package net.pixvi.myr.net
|
||||
{
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
|
||||
public class NetTeam
|
||||
{
|
||||
|
||||
private static const SET_MON:String = "monsterService/monsterPlaceBattleTeam";
|
||||
|
||||
private static const SET_EMPTY:String = "monsterService/monsterWithdrawBattleTeam";
|
||||
|
||||
private var onMonOnComplete:Function;
|
||||
|
||||
private var onMonOffComplete:Function;
|
||||
|
||||
public function NetTeam()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function getIns() : NetTeam
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(NetTeam) as NetTeam;
|
||||
}
|
||||
|
||||
public function monOn(monsterId:Number, battleTeamName:String, position:int, onComplete:Function) : void
|
||||
{
|
||||
onMonOnComplete = onComplete;
|
||||
var para:Object = {
|
||||
"monsterId":monsterId,
|
||||
"battleTeamName":battleTeamName,
|
||||
"position":position
|
||||
};
|
||||
NetCenter.getIns().send("monsterService/monsterPlaceBattleTeam",para,monOnHandler);
|
||||
}
|
||||
|
||||
private function monOnHandler(re:Object = null) : void
|
||||
{
|
||||
if(onMonOnComplete != null)
|
||||
{
|
||||
onMonOnComplete();
|
||||
onMonOnComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function monOff(battleTeamName:String, position:int, onComplete:Function) : void
|
||||
{
|
||||
onMonOffComplete = onComplete;
|
||||
var para:Object = {
|
||||
"battleTeamName":battleTeamName,
|
||||
"position":position
|
||||
};
|
||||
NetCenter.getIns().send("monsterService/monsterWithdrawBattleTeam",para,monOffHandler);
|
||||
}
|
||||
|
||||
private function monOffHandler(re:Object = null) : void
|
||||
{
|
||||
if(onMonOffComplete != null)
|
||||
{
|
||||
onMonOffComplete();
|
||||
onMonOffComplete = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user