public void TestSetUpTilesForPlayer() { RealEstateMarket market = new RealEstateMarket(2); TileManager.LoadSetUpTiles(market.Stacks.LoadedTiles); Assert.AreEqual(3, TileManager.GetSetUpTiles().Count); player = new Player(); manager.AddPlayer(player); Assert.AreEqual(0, player.tiles.Count); Assert.AreEqual(15, player.money); Assert.AreEqual(0, player.income); Assert.AreEqual(0, player.reputation); Assert.AreEqual(0, player.population); manager.SetUpTilesForPlayer(player); Assert.AreEqual(3, player.tiles.Count); // The player didn't lose any money Assert.AreEqual(15, player.money); // The player's income didn't change Assert.AreEqual(0, player.income); // The player's reputation increased by 1 (+2 from park and -1 from factory) Assert.AreEqual(1, player.reputation); // The player's population increased by 2 (suburbs) Assert.AreEqual(2, player.population); }
public void StartGame(int p_nb_players) { m_market = new RealEstateMarket(p_nb_players); TileManager.LoadSetUpTiles(m_market.Stacks.LoadedTiles); TileView.InitProperties(); m_game_manager = new TileManager(); m_game_manager.InitPlayers(p_nb_players); m_current_player = 0; m_remaining_turns = -1; m_turn_manager = new PlayerTurnManager(); m_eventBus.FireEvent(new EventGameStarted()); }
// Use this for initialization void Start() { Debug.Log("Loading Real Estate Market..."); Suburbia.Bus.AddHandler(EventTileRemovedFromREM.TYPE, this); m_market = Suburbia.Market; m_tiles = new List <TileREMView> (); m_cam = GameObject.FindWithTag("RealEstateCamera").camera; if (m_market.tiles.Count > 0) { Vector3 value = m_cam.WorldToScreenPoint(new Vector3(2, 0)); m_delta_tile = (int)value.x - Screen.width / 2; m_delta_tile_world = 2f; } else { m_delta_tile = 85; } SetPositionOfTiles(); }
// Use this for initialization void Start() { Debug.Log ("Loading Real Estate Market..."); Suburbia.Bus.AddHandler (EventTileRemovedFromREM.TYPE, this); m_market = Suburbia.Market; m_tiles = new List<TileREMView> (); m_cam = GameObject.FindWithTag ("RealEstateCamera").camera; if (m_market.tiles.Count > 0) { Vector3 value = m_cam.WorldToScreenPoint (new Vector3 (2, 0)); m_delta_tile = (int)value.x - Screen.width / 2; m_delta_tile_world = 2f; } else m_delta_tile = 85; SetPositionOfTiles (); }
public RealEstateMarketView() { m_market = null; }
public void Init() { market = new RealEstateMarket(2); }
public void ClearGame() { m_market = null; m_game_manager = null; m_remaining_turns = -1; }
public void StartGame(int p_nb_players) { m_market = new RealEstateMarket (p_nb_players); TileManager.LoadSetUpTiles (m_market.Stacks.LoadedTiles); TileView.InitProperties (); m_game_manager = new TileManager (); m_game_manager.InitPlayers (p_nb_players); m_current_player = 0; m_remaining_turns = -1; m_turn_manager = new PlayerTurnManager(); m_eventBus.FireEvent(new EventGameStarted()); }