-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTileProperties.cs
More file actions
45 lines (39 loc) · 871 Bytes
/
TileProperties.cs
File metadata and controls
45 lines (39 loc) · 871 Bytes
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
using System.Collections.Generic;
namespace Tiler
{
public struct TileProperties
{
#region static
private static List<TileProperties> propertyList = new List<TileProperties>();
static TileProperties()
{
Register(new TileProperties()
{
Filename = "space.png",
Name = "Space",
PlayerAcceleration = 0,
Friction = 1,
IsSolid = false
});
}
public static int Register(TileProperties properties)
{
propertyList.Add(properties);
return propertyList.Count - 1;
}
public static TileProperties GetByIndex(int index)
{
return propertyList[index];
}
public static TileProperties GetByName(string name)
{
return propertyList.Find(tp => tp.Name == name);
}
#endregion
public string Filename;
public string Name;
public float PlayerAcceleration;
public float Friction;
public bool IsSolid;
}
}