Revision 1822,
1.3 KB
checked in by tekrjant, 10 years ago
(diff) |
Generates random map on startup.
Saving works and loading added
Minor "optimization" done
|
Line | |
---|
1 | using System; |
---|
2 | using System.Collections.Generic; |
---|
3 | using System.Linq; |
---|
4 | using System.Text; |
---|
5 | using Microsoft.Xna.Framework; |
---|
6 | using Microsoft.Xna.Framework.Graphics; |
---|
7 | |
---|
8 | namespace AdventureGame |
---|
9 | { |
---|
10 | public class HUD |
---|
11 | { |
---|
12 | public Viewport ViewPort { get; set; } |
---|
13 | public List<Button> Buttons { get; set; } |
---|
14 | public MiniMap MiniMap; |
---|
15 | |
---|
16 | public Button SelectedButton; |
---|
17 | public TileType SelectedTileButtonType; |
---|
18 | |
---|
19 | public HUD() |
---|
20 | { |
---|
21 | Buttons = new List<Button>(); |
---|
22 | } |
---|
23 | |
---|
24 | public void AddMiniMap(MiniMap minimap) |
---|
25 | { |
---|
26 | MiniMap = minimap; |
---|
27 | } |
---|
28 | |
---|
29 | public void AddButton(Button button) |
---|
30 | { |
---|
31 | Buttons.Add(button); |
---|
32 | } |
---|
33 | |
---|
34 | public void Select(Button button) |
---|
35 | { |
---|
36 | for (int i = 0; i < Buttons.Count; i++) |
---|
37 | { |
---|
38 | Buttons[i].Selected = false; |
---|
39 | } |
---|
40 | button.Selected = true; |
---|
41 | SelectedButton = button; |
---|
42 | } |
---|
43 | |
---|
44 | public void Draw(SpriteBatch sb) |
---|
45 | { |
---|
46 | foreach (Button button in Buttons) |
---|
47 | { |
---|
48 | button.Draw(sb); |
---|
49 | } |
---|
50 | } |
---|
51 | |
---|
52 | public void DrawMinimap(SpriteBatch sb) |
---|
53 | { |
---|
54 | MiniMap.Draw(sb); |
---|
55 | } |
---|
56 | } |
---|
57 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.