示例#1
0
 public CmdBallQueue(int side, List <int> queue) : this()
 {
     CmdData                 = new StructBattleCommand();
     CmdData.Side            = (sbyte)side;
     CmdData.Type            = (int)Type;
     CmdData.BallQueue       = new BallQueue();
     CmdData.BallQueue.Queue = queue;
 }
示例#2
0
 public CmdSceneTransform(Vector2 translation, float rotation) : this()
 {
     CmdData                              = new StructBattleCommand();
     CmdData.Side                         = 2;
     CmdData.Type                         = (int)Type;
     CmdData.SceneTransform               = new SceneTransform();
     CmdData.SceneTransform.Translation   = new Vector2D();
     CmdData.SceneTransform.Translation.X = translation.x;
     CmdData.SceneTransform.Translation.Y = translation.y;
     CmdData.SceneTransform.Rotation      = rotation;
 }
示例#3
0
        public static BattleCommand CreateInstance(StructBattleCommand cmd)
        {
            EBattleCommandType type = (EBattleCommandType)cmd.Type;

            if (s_battleCommandConstructorDic.ContainsKey(type))
            {
                BattleCommand command = s_battleCommandConstructorDic[type].Invoke(new object[] { cmd }) as BattleCommand;
                return(command);
            }

            return(null);
        }
示例#4
0
 public CmdFallBall(int side, int reason, List <int> ballIds, int collisionBallId = -1) : this()
 {
     CmdData                  = new StructBattleCommand();
     CmdData.Side             = (sbyte)side;
     CmdData.Type             = (int)Type;
     CmdData.FallBall         = new FallBall();
     CmdData.FallBall.Reason  = (sbyte)reason;
     CmdData.FallBall.BallIds = ballIds;
     if (reason == 0)
     {
         CmdData.FallBall.CollisionBallId = collisionBallId;
     }
 }
示例#5
0
 public CmdFireBall(int side, int type, Vector2 startPosition, Vector2 dir, Vector2 collisionPoint, GridPosition destGrid, bool isFlyout, float speed) : this()
 {
     CmdData                           = new StructBattleCommand();
     CmdData.Side                      = (sbyte)side;
     CmdData.Type                      = (int)Type;
     CmdData.FireBall                  = new FireBall();
     CmdData.FireBall.Type             = type;
     CmdData.FireBall.StartPosition    = new Vector2D();
     CmdData.FireBall.StartPosition.X  = startPosition.x;
     CmdData.FireBall.StartPosition.Y  = startPosition.y;
     CmdData.FireBall.Dir              = new Vector2D();
     CmdData.FireBall.Dir.X            = dir.x;
     CmdData.FireBall.Dir.Y            = dir.y;
     CmdData.FireBall.CollisionPoint   = new Vector2D();
     CmdData.FireBall.CollisionPoint.X = collisionPoint.x;
     CmdData.FireBall.CollisionPoint.Y = collisionPoint.y;
     CmdData.FireBall.DestGrid         = new GridCoord();
     CmdData.FireBall.DestGrid.Col     = destGrid.col;
     CmdData.FireBall.DestGrid.Row     = destGrid.row;
     CmdData.FireBall.IsFlyout         = isFlyout;
     CmdData.FireBall.Speed            = speed;
 }
示例#6
0
 public CmdFireBallResponse(int side, int type, Vector2 startPosition, Vector2 dir, Vector2 collisionPoint, GridPosition destGrid, int ballId, float speed, int result) : this()
 {
     CmdData                                   = new StructBattleCommand();
     CmdData.Side                              = (sbyte)side;
     CmdData.Type                              = (int)Type;
     CmdData.FireBallResponse                  = new FireBallResponse();
     CmdData.FireBallResponse.Type             = type;
     CmdData.FireBallResponse.StartPosition    = new Vector2D();
     CmdData.FireBallResponse.StartPosition.X  = startPosition.x;
     CmdData.FireBallResponse.StartPosition.Y  = startPosition.y;
     CmdData.FireBallResponse.Dir              = new Vector2D();
     CmdData.FireBallResponse.Dir.X            = dir.x;
     CmdData.FireBallResponse.Dir.Y            = dir.y;
     CmdData.FireBallResponse.CollisionPoint   = new Vector2D();
     CmdData.FireBallResponse.CollisionPoint.X = collisionPoint.x;
     CmdData.FireBallResponse.CollisionPoint.Y = collisionPoint.y;
     CmdData.FireBallResponse.DestGrid         = new GridCoord();
     CmdData.FireBallResponse.DestGrid.Col     = destGrid.col;
     CmdData.FireBallResponse.DestGrid.Row     = destGrid.row;
     CmdData.FireBallResponse.BallId           = ballId;
     CmdData.FireBallResponse.Speed            = speed;
     CmdData.FireBallResponse.Result           = (sbyte)result;
 }
示例#7
0
 private CmdFallBall(StructBattleCommand cmd) : this()
 {
     CmdData = cmd;
 }
示例#8
0
 private ProtoSCBattleCommand() : base(MessageId.SC_BattleCommand)
 {
     m_data = new StructBattleCommand();
 }
示例#9
0
 public CmdExchangeBall(int side) : this()
 {
     CmdData      = new StructBattleCommand();
     CmdData.Side = (sbyte)side;
     CmdData.Type = (int)Type;
 }
示例#10
0
 private CmdExchangeBall(StructBattleCommand cmd) : this()
 {
     CmdData = cmd;
 }
示例#11
0
 public ProtoCSBattleCommand(BattleCommand cmd) : this()
 {
     m_data = cmd.CmdData;
 }
示例#12
0
 private ProtoCSBattleCommand() : base(MessageId.CS_BattleCommand)
 {
     m_data = new StructBattleCommand();
 }
示例#13
0
 private CmdSceneTransform(StructBattleCommand cmd) : this()
 {
     CmdData = cmd;
 }
示例#14
0
 private CmdFireBallResponse(StructBattleCommand cmd) : this()
 {
     CmdData = cmd;
 }
示例#15
0
 private CmdBallQueue(StructBattleCommand cmd) : this()
 {
     CmdData = cmd;
 }