Пример #1
0
    public void RecordDropArmy(ConstructArmyCommand command)
    {
        if (BattleDirector.Instance == null || !BattleDirector.Instance.IsBattleFinished)
        {
            if (!this.m_DropArmyCommands.ContainsKey(command.Identity.armyType))
            {
                this.m_DropArmyCommands.Add(command.Identity.armyType, new List <RecordUserCommand <ArmyIdentity> >());
            }
            RecordUserCommand <ArmyIdentity> dropCommand = new RecordUserCommand <ArmyIdentity>()
            {
                ConstructCommand = command, DroppedFrame = TimeTickRecorder.Instance.CurrentTimeTick - this.BattleStartTime
            };
            this.m_DropArmyCommands[command.Identity.armyType].Add(dropCommand);

            if (BattleDirector.Instance != null)
            {
                DropArmyRequestParameter request = new DropArmyRequestParameter();
                request.ArmyType    = command.Identity.armyType;
                request.ArmyNO      = command.Identity.armyNO;
                request.Level       = command.Level;
                request.OperateTime = TimeTickRecorder.Instance.CurrentTimeTick - BattleDirector.Instance.MatchStartTick;
                request.PositionX   = command.Position.x;
                request.PositionY   = command.Position.y;
                CommunicationUtility.Instance.DropArmy(request);

                LogicController.Instance.DropArmy(command.Identity);
            }
        }
    }
Пример #2
0
 public void DropArmy(DropArmyRequestParameter parameter)
 {
     this.CommunicateWithServer(parameter.GetHashtableFromParameter(), ClientCommandConsts.DROP_ARMY_COMMAND);
 }