-
Notifications
You must be signed in to change notification settings - Fork 1
/
Stage.cs
60 lines (50 loc) · 1.33 KB
/
Stage.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
namespace Kirby
{
public class Stage : IStateable
{
public List<GameObject> Terrain;
public List<Enemy> Enemies;
public List<int> StateList;
public int Length;
public int Height;
public Vector2 ScreenDisplacement;
public Vector2 StartPosition;
public Stage()
{
Terrain = new List<GameObject>();
Enemies = new List<Enemy>();
StateList = new List<int>();
ScreenDisplacement = new Vector2(0, 0);
}
public void AddTerrain(GameObject terrain)
{
terrain.AddState(State.SOLID);
this.Terrain.Add(terrain);
}
public void AddEnemy(Enemy enemy)
{
enemy.AddState(State.SOLID);
this.Enemies.Add(enemy);
}
public void AddState(int state)
{
if (!this.HasState(state))
StateList.Add(state);
}
public bool HasState(int state)
{
if (StateList.Contains(state))
return true;
return false;
}
public void RemoveState(int state)
{
StateList.Remove(state);
}
}
}