Example #1
0
 /// <summary>
 /// Creates a new cardslot
 /// </summary>
 /// <param name="ownerTile">The tile that this cardslot belongs to</param>
 /// <param name="x">The x position of the cardslot</param>
 /// <param name="y">The y position of the cardslot</param>
 /// <param name="slotPos">The cardslot's position above or below the tile</param>
 public CardSlot(Tile ownerTile, int x, int y, Position slotPos)
     : base(x, y)
 {
     OwnerTile = ownerTile;
     SlotPosition = slotPos;
 }
Example #2
0
 /// <summary>
 /// Fill a tile with the appropriate amount of cubes from the bag
 /// </summary>
 /// <param name="tile">The tile to add the cubes to</param>
 public bool FillTile(Tile tile)
 {
     // Return false if the bag doesn't have enough Cubes
     if (bag.Count < tile.Number)
     {
         Output("You feel around desperately but it's no good! The bag is empty! You remove a tile and keep playing..");
         return false;
     }
     else
     {
         for (int i = 0; i < tile.Number; i++)
         {
             Cube cube = bag[rand.Next(0, bag.Count - 1)];
             tile.AddCube(cube);
             bag.Remove(cube);
         }
         return true;
     }
 }