コード例 #1
0
    public void RecordDropMercenary(UserCommand <MercenaryIdentity> command)
    {
        if (BattleDirector.Instance == null || !BattleDirector.Instance.IsBattleFinished)
        {
            if (!this.m_DropMercenaryCommands.ContainsKey(command.Identity.mercenaryType))
            {
                this.m_DropMercenaryCommands.Add(command.Identity.mercenaryType, new List <RecordUserCommand <MercenaryIdentity> >());
            }
            RecordUserCommand <MercenaryIdentity> dropCommand = new RecordUserCommand <MercenaryIdentity>()
            {
                ConstructCommand = command, DroppedFrame = TimeTickRecorder.Instance.CurrentTimeTick - this.BattleStartTime
            };
            this.m_DropMercenaryCommands[command.Identity.mercenaryType].Add(dropCommand);

            if (BattleDirector.Instance != null)
            {
                DropMercenaryRequestParameter request = new DropMercenaryRequestParameter();
                request.MercenaryType = command.Identity.mercenaryType;
                request.MercenaryNO   = command.Identity.mercenaryNO;
                request.PositionX     = command.Position.x;
                request.PositionY     = command.Position.y;
                request.OperateTime   = TimeTickRecorder.Instance.CurrentTimeTick - BattleDirector.Instance.MatchStartTick;
                CommunicationUtility.Instance.DropMercenary(request);

                LogicController.Instance.DropMercenary(command.Identity);
            }
        }
    }
コード例 #2
0
 public void DropMercenary(DropMercenaryRequestParameter paramter)
 {
     this.CommunicateWithServer(paramter.GetHashtableFromParameter(), ClientCommandConsts.DROP_MERCENARY_COMMAND);
 }