Beispiel #1
0
        private static void place_house(Property property, ref string[] board_art, int row, int col)
        {
            // create string of players at space
            string current = board_art[row].Substring(col, 5); // take 5-length substring in case of max. 5 houses
            string updated = "";

            if (property.owned())
            {
                if (property.get_houses() == 5) // hotel
                {
                    updated = "Hotel";
                }
                else if (property.mortgaged())
                {
                    updated = "mmmmm";
                }
                else // everything else
                {
                    for (int i = 0; i < 5; i++)
                    {
                        if (i < (property.get_houses()))
                        {
                            updated += "h";
                        }
                        else
                        {
                            updated += "-";
                        }
                    }
                }
            }
            else
            {
                updated = current;
            }

            // update board
            board_art[row] = board_art[row].Substring(0, col) + updated + board_art[row].Substring(col + 5);
        }