Beispiel #1
0
 public Tile(Texture2D floor, TileTypeByMap tileTypeByMap)
 {
     this.Floor = floor;
     this._tileTypeByMap = tileTypeByMap;
     this._tileTypeByData = TileTypeByData.Free;
     this._symbol = ' ';
 }
Beispiel #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;
         }
 }
Beispiel #3
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.");
         }
 }