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

Revision 1822, 1.1 KB checked in by tekrjant, 8 years ago (diff)

Generates random map on startup.
Saving works and loading added
Minor "optimization" done

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 bool Selected { get; set; }
24        public TileType TileType { get; set; }
25
26        public bool Passable { get; set; }
27
28        public Tile(TileType tileType, Rectangle boundaries)
29        {
30            this.TileType = tileType;
31            this.Boundaries = boundaries;
32        }
33
34        public Tile(Texture2D image, Vector2 position, int width, int height)
35        {
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.