Example #1
0
    public void RecordUseProps(UsePropsCommand command)
    {
        if (BattleDirector.Instance == null || !BattleDirector.Instance.IsBattleFinished)
        {
            if (!this.m_UsePropsCommands.ContainsKey(command.Identity))
            {
                this.m_UsePropsCommands.Add(command.Identity, new List <RecordUserCommand <int> >());
            }
            RecordUserCommand <int> useCommand = new RecordUserCommand <int>()
            {
                ConstructCommand = command, DroppedFrame = TimeTickRecorder.Instance.CurrentTimeTick - this.BattleStartTime
            };
            this.m_UsePropsCommands[command.Identity].Add(useCommand);

            if (BattleDirector.Instance != null)
            {
                UsePropsInBattleRequestParameter request = new UsePropsInBattleRequestParameter();
                request.PropsNo     = command.Identity;
                request.PositionX   = command.Position.x;
                request.PositionY   = command.Position.y;
                request.OperateTime = TimeTickRecorder.Instance.CurrentTimeTick - this.BattleStartTime;
                CommunicationUtility.Instance.UsePropsInBattle(request);

                LogicController.Instance.UsePropsInBattle(command.Identity);
            }
        }
    }
 public void UsePropsInBattle(UsePropsInBattleRequestParameter parameter)
 {
     this.CommunicateWithServer(parameter.GetHashtableFromParameter(), ClientCommandConsts.USE_PROPS_IN_BATTLE_COMMAND);
 }