World: move Tile to bottom of file
This commit is contained in:
parent
bb910fbe58
commit
3fc8b49636
@ -3,34 +3,9 @@ using Microsoft.Xna.Framework.Graphics;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace SemiColinGames {
|
||||
|
||||
public class Tile {
|
||||
public static int CompareByX(Tile t1, Tile t2) {
|
||||
return t1.Position.X.CompareTo(t2.Position.X);
|
||||
}
|
||||
|
||||
private TextureRef texture;
|
||||
private Rectangle textureSource;
|
||||
|
||||
public Tile(TextureRef texture, Rectangle textureSource, Rectangle position, bool isHazard) {
|
||||
Position = position;
|
||||
this.texture = texture;
|
||||
this.textureSource = textureSource;
|
||||
IsHazard = isHazard;
|
||||
}
|
||||
|
||||
public Rectangle Position { get; private set; }
|
||||
public bool IsHazard = false;
|
||||
|
||||
public void Draw(SpriteBatch spriteBatch) {
|
||||
spriteBatch.Draw(
|
||||
texture.Get, Position.Location.ToVector2(), textureSource, Color.White);
|
||||
}
|
||||
}
|
||||
|
||||
public class World {
|
||||
|
||||
public const int TileSize = 16;
|
||||
@ -193,4 +168,28 @@ namespace SemiColinGames {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class Tile {
|
||||
public static int CompareByX(Tile t1, Tile t2) {
|
||||
return t1.Position.X.CompareTo(t2.Position.X);
|
||||
}
|
||||
|
||||
private TextureRef texture;
|
||||
private Rectangle textureSource;
|
||||
|
||||
public Tile(TextureRef texture, Rectangle textureSource, Rectangle position, bool isHazard) {
|
||||
Position = position;
|
||||
this.texture = texture;
|
||||
this.textureSource = textureSource;
|
||||
IsHazard = isHazard;
|
||||
}
|
||||
|
||||
public Rectangle Position { get; private set; }
|
||||
public bool IsHazard = false;
|
||||
|
||||
public void Draw(SpriteBatch spriteBatch) {
|
||||
spriteBatch.Draw(
|
||||
texture.Get, Position.Location.ToVector2(), textureSource, Color.White);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user