Example #1
0
 public Tile(Texture2D floor, TileTypeByMap tileTypeByMap)
 {
     this.Floor = floor;
     this._tileTypeByMap = tileTypeByMap;
     this._tileTypeByData = TileTypeByData.Free;
     this._symbol = ' ';
 }
Example #2
0
 public void SetOccupationByFruit()
 {
     if (this._tileTypeByMap == TileTypeByMap.Wall)
         throw new TileException(TileExceptionType.Error, "Wall tile cannot be occupied.");
     if (this._tileTypeByData == TileTypeByData.Static)
         throw new TileException(TileExceptionType.Error, "Tile is already occupied by a static item.");
     this._tileTypeByData = TileTypeByData.Static;
     if (this._tileTypeByMap == TileTypeByMap.Floor)
         {
         this._tileTypeByMap = TileTypeByMap.PotentiallyOccupied;
         }
 }
Example #3
0
 public void CheckIfIncorrectlyPotentiallyOccupied()
 {
     if (this._tileTypeByMap == TileTypeByMap.PotentiallyOccupied && this._tileTypeByData == TileTypeByData.Free)
         {
         this._tileTypeByMap = TileTypeByMap.Floor;
         throw new TileException(TileExceptionType.Warning, "Tile is marked as potentially occupied (symbol " + this._symbol + ") but is not occupied.");
         }
     if (this._tileTypeByMap == TileTypeByMap.Floor && this._tileTypeByData != TileTypeByData.Free)
         {
         this._tileTypeByMap = TileTypeByMap.PotentiallyOccupied;
         throw new TileException(TileExceptionType.Warning, "Tile is not marked as potentially occupied but is occupied.");
         }
 }
Example #4
0
 public void SetOccupationByMovingMonster()
 {
     if (this._tileTypeByMap == TileTypeByMap.Wall)
         throw new TileException(TileExceptionType.Error, "Wall tile cannot be occupied.");
     if (this._tileTypeByData == TileTypeByData.Free)
         this._tileTypeByData = TileTypeByData.Moving;
     if (this._tileTypeByMap == TileTypeByMap.Floor)
         {
         this._tileTypeByMap = TileTypeByMap.PotentiallyOccupied;
         throw new TileException(TileExceptionType.Warning, "Tile is not marked as potentially occupied.");
         }
 }
Example #5
0
 private TileUsage(char symbol, string description)
 {
     this._symbol       = symbol;
     this._description  = description;
     this.TileTypeByMap = TileTypeByMap.Object;
 }
Example #6
0
 private TileUsage(char symbol, TileTypeByMap tileTypeByMap)
 {
     this.TileTypeByMap = tileTypeByMap;
     this._symbol       = symbol;
     this._description  = tileTypeByMap.ToString();
 }