Guest User

Untitled

a guest
Sep 7th, 2011
21
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.78 KB | None | 0 0
  1. ...
  2.     internal virtual Tile TileAt(Int32 x, Int32 y)
  3.     {
  4.         // The default way for a realm to work is by wrapping. This method can be overridden if other methods are desired.
  5.         while (x < 0)
  6.             x += this.width;
  7.         while (x >= this.width)
  8.             x -= this.width;
  9.  
  10.         if (y < 0) // This is above the top most tiles, should default to empty blocks of air.
  11.             return new Tile() { BackType = TileBackType.None, BaseType = TileBaseType.Air, OverType = TileOverType.None };
  12.         if (y >= this.Height) // This is below ground, on the lowest levels. Defaults to Stone for now.
  13.             return new Tile() { BackType = TileBackType.None, BaseType = TileBaseType.Stone, OverType = TileOverType.None };
  14.  
  15.         return this.Tiles[x, y];
  16.     }
  17. ...
Advertisement
Add Comment
Please, Sign In to add comment