Ejemplo n.º 1
0
        protected override void OnCommand(Cmd cmd)
        {
            if (cmd.Code == CmdCode.Explode)
            {
                if (cmd is MovementCmd)
                {
                    MovementCmd explodeCmd = (MovementCmd)cmd;
                    Debug.Assert(explodeCmd.HasTarget);

                    Coordinate to = explodeCmd.Coordinates[1];
                    int        targetPlayerIndex = explodeCmd.TargetPlayerIndex;
                    long       targetIndex       = explodeCmd.TargetIndex;

                    Explode(targetPlayerIndex, targetIndex, to);
                }
                else
                {
                    TargetCmd explodeCmd = (TargetCmd)cmd;
                    if (explodeCmd.HasTarget)
                    {
                        Coordinate to = m_dataController.Coordinate;

                        int  targetPlayerIndex = explodeCmd.TargetPlayerIndex;
                        long targetIndex       = explodeCmd.TargetIndex;

                        Explode(targetPlayerIndex, targetIndex, to);
                    }
                }
            }
        }
Ejemplo n.º 2
0
 public TargetCmd(TargetCmd cmd) : base(cmd)
 {
     TargetPlayerIndex = cmd.TargetPlayerIndex;
     TargetIndex       = cmd.TargetIndex;
 }