//constructor with given x,y, and z coords //public Tile(int inX, int inY, int inZ) public Tile(int inZ) { jumpable = false; aDirection = new AFrom(false, false, false, false); randomEncounter = false; ramp = false; occupied = false; tileType = "debug_black_tile.png"; //MUST BE MADE UNIQUE //X = inX; //Y = inY; Z = (byte)inZ; }
public short Z; //global Z coordinate of tile #region Constructors //default is inaccessable tile public Tile() { jumpable = false; aDirection = new AFrom(false, false, false, false); randomEncounter = false; ramp = false; occupied = false; sceneryObject = null; tileType = "debug_black_tile.png"; //MUST BE MADE UNIQUE //X = 0; //Y = 0; Z = 0; }
public Tile(string zone, Rectangle srcRect) { jumpable = false; aDirection = new AFrom(false, false, false, false); randomEncounter = false; ramp = false; occupied = false; tileType = "debug_black_tile.png"; //MUST BE MADE UNIQUE //X = 0; //Y = 0; Z = 0; zoneName = zone; sourceRect = srcRect; }
//copy constructor public Tile(Tile inTile) { jumpable = inTile.isJumpable(); aDirection = new AFrom(inTile.aDirection.north, inTile.aDirection.east, inTile.aDirection.south, inTile.aDirection.west); randomEncounter = inTile.hasRandomEncounter(); ramp = inTile.isRamp(); occupied = inTile.isOccupied(); sourceRect = new Rectangle(inTile.sourceRect.X, inTile.sourceRect.Y, inTile.sourceRect.Width, inTile.sourceRect.Height); tileType = inTile.tileType; tilePath = inTile.tilePath; eventScript = inTile.eventScript; zoneName = inTile.zoneName; isWater = inTile.isWater; sceneryObject = inTile.sceneryObject; Z = inTile.Z; }
/*public void setTType(string type) * { * switch (type) * { * case "Black": * tileType = TType.Black; * //tileTexture = Globals.Content.Load<Texture2D>("Zone/Tile/Black"); //<---- we need to do something like this * break; * case "Grass": * tileType = TType.Grass; * //tileTexture = Globals.Content.Load<Texture2D>("Zone/Tile/Grass"); * break; * case "Dirt": * tileType = TType.Dirt; * //tileTexture = Globals.Content.Load<Texture2D>("Zone/Tile/Dirt"); * break; * case "Sand": * tileType = TType.Sand; * //tileTexture = Globals.Content.Load<Texture2D>("Zone/Tile/Sand"); * break; * case "Brick": * tileType = TType.Brick; * //tileTexture = Globals.Content.Load<Texture2D>("Zone/Tile/Brick"); * break; * } * }*/ #endregion //makes accessible from all directions public void setClear() { aDirection = new AFrom(true, true, true, true); occupied = false; }