Beispiel #1
0
 public ServerCurrentStateTransferMessage SetExit(int x, int y)
 {
     this.Exit   = this.Exit ?? PointSubMessage.Create();
     this.Exit.X = x;
     this.Exit.Y = y;
     return(this);
 }
Beispiel #2
0
        public ServerCurrentStateTransferMessage AddDoor(int x, int y)
        {
            var door = PointSubMessage.Create();

            door.X = x;
            door.Y = y;
            this.Doors.Add(door);
            return(this);
        }
Beispiel #3
0
        public ServerCurrentStateTransferMessage AddUnit(int playerIndex, int unitId, int posX, int posY, int hp)
        {
            var unit = UnitSubMessage.Create();

            unit.Hp         = hp;
            unit.UnitId     = unitId;
            unit.Position   = PointSubMessage.Create();
            unit.Position.X = posX;
            unit.Position.Y = posY;
            this.Players[playerIndex].Units.Add(unit);
            return(this);
        }
Beispiel #4
0
        public ClientTurnDoneTransferMessage SetNewPosition(int unitId, int x, int y)
        {
            if (!UnitActions.ContainsKey(unitId))
            {
                UnitActions[unitId] = UnitActionSubMessage.Create();
            }

            UnitActions[unitId].NewPosition   = UnitActions[unitId].NewPosition ?? PointSubMessage.Create();
            UnitActions[unitId].NewPosition.X = x;
            UnitActions[unitId].NewPosition.Y = y;
            return(this);
        }