示例#1
0
    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);
    }
示例#2
0
 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());
 }
示例#3
0
    // 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();
    }
示例#4
0
    // 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 ();
    }
示例#5
0
 public RealEstateMarketView()
 {
     m_market = null;
 }
示例#6
0
 public void Init()
 {
     market = new RealEstateMarket(2);
 }
示例#7
0
 public void ClearGame()
 {
     m_market          = null;
     m_game_manager    = null;
     m_remaining_turns = -1;
 }
示例#8
0
 public void Init()
 {
     market = new RealEstateMarket(2);
 }
示例#9
0
 public void ClearGame()
 {
     m_market = null;
     m_game_manager = null;
     m_remaining_turns = -1;
 }
示例#10
0
 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());
 }
示例#11
0
    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);
    }
示例#12
0
 public RealEstateMarketView()
 {
     m_market = null;
 }