source: 2011/23/sijoseha/AdventureGame/AdventureGame/Tile.cs @ 1758

Revision 1758, 1.2 KB checked in by tekrjant, 8 years ago (diff)

Minor changes

Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using Microsoft.Xna.Framework;
6using Microsoft.Xna.Framework.Graphics;
7
8namespace AdventureGame
9{
10    public enum TileType
11    {
12        Grass = 1,
13        Water = 2,
14        Sand = 3,
15        DarkGrass = 4,
16    }
17    public class Tile
18    {
19        public Vector2 Position { get { return new Vector2(Boundaries.X, Boundaries.Y); } set{} }
20        public Rectangle Boundaries { get; set; }
21        public int Width { get { return Boundaries.Width; } private set {} }
22        public int Height { get { return Boundaries.Height; } private set { } }
23        public Texture2D Image { get; set; }
24        public bool Selected { get; set; }
25        public TileType TileType { get; set; }
26
27        public Tile(TileType tileType, Rectangle boundaries)
28        {
29            this.TileType = tileType;
30            this.Boundaries = boundaries;
31        }
32
33        public Tile(Texture2D image, Vector2 position, int width, int height)
34        {
35            this.Image = image;
36            this.Boundaries = new Rectangle((int)position.X, (int)position.Y, width, height);
37        }
38    }
39}
Note: See TracBrowser for help on using the repository browser.