public void Should_return_all_exits() { _room = new GameLogic.World.Room.Room() { Exits = new ExitDirections() { NorthWest = new Exit() { Name = " North West", Door = false, }, North = new Exit() { Name = " North", Door = false, }, NorthEast = new Exit() { Name = " North East", Door = false, }, East = new Exit() { Name = " East", Door = false, }, SouthEast = new Exit() { Name = " South East", Door = false, }, South = new Exit() { Name = " South", Door = false, }, SouthWest = new Exit() { Name = " South West", Door = false, }, West = new Exit() { Name = " West", Door = false, }, } }; var exits = new RoomActions(_writer.Object, _time.Object).FindValidExits(_room); Assert.Equal(" North West, North, North East, East, South East, South, South West, West", exits); }
public RoomsViewModel(account cont) { _cont = cont; actions = new RoomActions(); if (cont.userType == "Admin") { IsAdmin = "Visible"; } else { IsAdmin = "Hidden"; } }
public void Should_return_none_exits() { _room = new GameLogic.World.Room.Room() { Exits = new ExitDirections() { } }; var exits = new RoomActions(_writer.Object).FindValidExits(_room); Assert.Equal("None", exits); }
public void Should_return_none_exits() { _room = new GameLogic.World.Room.Room() { Exits = new ExitDirections() { } }; var exits = new RoomActions(_writer.Object, _time.Object, _cache.Object, _dice.Object, _gain.Object, _formulas.Object).FindValidExits(_room, false); Assert.Equal("None", exits); }
public void Should_return_east_exits() { _room = new GameLogic.World.Room.Room() { Exits = new ExitDirections() { East = new Exit() { Name = "East" } } }; var exits = new RoomActions(_writer.Object).FindValidExits(_room); Assert.Equal("East", exits); }
public void Should_return_custom_exits() { _room = new GameLogic.World.Room.Room() { Exits = new ExitDirections() { NorthWest = new Exit() { Name = "A hole in the wall" } } }; var exits = new RoomActions(_writer.Object).FindValidExits(_room); Assert.Equal("A hole in the wall", exits); }
public Room ConstructRoom(int id) { string model = RoomActions.GetRoomModelFromRoomId(id); if (!_modelTypeLookup.ContainsKey(model)) { FindNewModelTypes(); } if (!_modelTypeLookup.ContainsKey(model)) { throw new Exception(CoreManager.ServerCore.StringLocale.GetString("CORE:ERROR_ROOM_MODEL_MISSING", model)); } Type modelType = _modelTypeLookup[model]; return((Room)Activator.CreateInstance(modelType, new object[] { id })); // This might be slow. Keep that in mind if performance becomes a problem. }
public void Should_return_northEast_exits() { _room = new GameLogic.World.Room.Room() { Exits = new ExitDirections() { NorthEast = new Exit() { Name = "North East", Door = false, } } }; var exits = new RoomActions(_writer.Object, _time.Object).FindValidExits(_room); Assert.Equal("North East", exits); }
public void Should_return_south_west_exits() { _room = new GameLogic.World.Room.Room() { Exits = new ExitDirections() { SouthWest = new Exit() { Name = "South West", Door = false, } } }; var exits = new RoomActions(_writer.Object, _time.Object, _cache.Object).FindValidExits(_room, false); Assert.Equal("South West", exits); }
public void Should_return_custom_exits() { _room = new GameLogic.World.Room.Room() { Exits = new ExitDirections() { NorthWest = new Exit() { Name = "A hole in the wall", Door = false, } } }; var exits = new RoomActions(_writer.Object, _time.Object, _cache.Object, _dice.Object, _gain.Object, _formulas.Object).FindValidExits(_room, false); Assert.Equal("A hole in the wall", exits); }
public void Should_return_east_exits() { _room = new GameLogic.World.Room.Room() { Exits = new ExitDirections() { East = new Exit() { Name = "East", Door = false, Coords = new Coordinates() } } }; var exits = new RoomActions(_writer.Object, _time.Object, _cache.Object, _dice.Object, _gain.Object, _formulas.Object).FindValidExits(_room, false); Assert.Equal("East", exits); }
public FormRoomViewModel(account cont, room room) { _cont = cont; _room = room; Capacity = room.capacity.ToString(); Price = room.price.ToString(); NumberOfRooms = room.numberofrooms.ToString(); Visible = "Visible"; if (cont.userType == "Admin") { IsAdmin = "Visible"; } else { IsAdmin = "Hidden"; } actions = new RoomActions(); }
public FormRoomViewModel() { actions = new RoomActions(); Visible = "Hidden"; }
public RoomActionModel(RoomActions command, Room room) { Command = command; Room = room; }
public void Should_return_all_exits() { _room = new GameLogic.World.Room.Room() { Exits = new ExitDirections() { NorthWest = new Exit() { Name = " North West", Door = false, Coords = new Coordinates() }, North = new Exit() { Name = " North", Door = false, Coords = new Coordinates() }, NorthEast = new Exit() { Name = " North East", Door = false, Coords = new Coordinates() }, East = new Exit() { Name = " East", Door = false, Coords = new Coordinates() }, SouthEast = new Exit() { Name = " South East", Door = false, Coords = new Coordinates() }, South = new Exit() { Name = " South", Door = false, Coords = new Coordinates() }, SouthWest = new Exit() { Name = " South West", Door = false, Coords = new Coordinates() }, West = new Exit() { Name = " West", Door = false, Coords = new Coordinates() }, } }; var exits = new RoomActions(_writer.Object, _time.Object, _cache.Object, _dice.Object, _gain.Object, _formulas.Object).FindValidExits(_room, false); Assert.Equal(" North, East, South, West, North East, South East, South West, North West", exits); }