Ejemplo n.º 1
0
        public void TileSerializesToJson()
        {
            Tile   tile       = new Tile(123, TileMovementFlags.BulletPassable | TileMovementFlags.Passable);
            string serialized = TileSerializer.Serialize(tile);

            string expected = "{\"MovementFlags\":5,\"Id\":123}";

            Assert.That(serialized, Is.EqualTo(expected));
        }
Ejemplo n.º 2
0
        public ActionResult <string> GetTile([FromRoute] int id)
        {
            Tile tile = MasterGameController.TheGame.Tiles?.Find(t => t.Id == id);

            if (tile == null)
            {
                return(NotFound());
            }
            return(TileSerializer.Serialize(tile));
        }