Beispiel #1
0
        public TriviaBoard()
        {
            GameMap            = new TriviaTile[5, 5];
            SoftLocksRemaining = 0;
            BuildNextTile(XPos, YPos);
            MyLoc    = GameMap[XPos, YPos];
            MAX_SIZE = 5;
            XPos     = YPos = 0;

            //grab all sqlite data
            ConfigureDatabase();
        }
Beispiel #2
0
 public TriviaBoard()
 {
     GameMap = new TriviaTile[5, 5];
     for (int i = 0; i < GameMap.GetLength(0); i++)
     {
         for (int j = 0; j < GameMap.GetLength(0); j++)
         {
             GameMap[i, j] = new TriviaTile();
         }
     }
     MyLoc    = new TriviaTile();
     MAX_SIZE = 5;
     XPos     = YPos = 0;
 }
Beispiel #3
0
 //call to build a tile at the location passed in
 //TODO: fix softlock count. when we build a new room, we need to unlock the door we came from
 private void BuildNextTile(int x, int y)
 {
     if (GameMap[x, y] == null)
     {
         Log($"Creating tile <{x},{y}> and assigning to MyLoc");
         GameMap[x, y] = new TriviaTile(x, y);
         MyLoc         = GameMap[x, y];
         //Log($"Adding {MyLoc.LocksCount} to lock total");
         SoftLocksRemaining += MyLoc.LocksCount;
         //Log($"Active SoftLocks - {SoftLocksRemaining}");
     }
     else
     {
         Log("Tile already exists, Updating MyLoc");
         MyLoc = GameMap[x, y];
     }
 }
Beispiel #4
0
        //overload to handle unlocking the door we came from
        private void BuildNextTile(int x, int y, Direction CameFrom)
        {
            if (GameMap[x, y] == null)
            {
                Log($"Creating tile <{x},{y}> and assigning to MyLoc");
                GameMap[x, y] = new TriviaTile(x, y);
                MyLoc         = GameMap[x, y];
                //Log($"Adding {MyLoc.LocksCount} to lock total");
                switch (CameFrom)
                {
                case Direction.North:
                    MyLoc.NorthLock = Lock.Unlocked;
                    break;

                case Direction.South:
                    MyLoc.SouthLock = Lock.Unlocked;
                    break;

                case Direction.East:
                    MyLoc.EastLock = Lock.Unlocked;
                    break;

                case Direction.West:
                    MyLoc.WestLock = Lock.Unlocked;
                    break;
                }
                SoftLocksRemaining += MyLoc.LocksCount;
                FixLocks();
                //Log($"Active SoftLocks - {SoftLocksRemaining}");
            }
            else
            {
                Log("Tile already exists, Updating MyLoc");
                MyLoc = GameMap[x, y];
            }
        }