-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTileInfo.cs
More file actions
66 lines (58 loc) · 1.85 KB
/
Copy pathTileInfo.cs
File metadata and controls
66 lines (58 loc) · 1.85 KB
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
61
62
63
64
65
66
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Xna.Framework;
namespace CastleGenerator
{
public class TileInfo
{
public Color Code = Color.White;
public bool Active = false;
public ushort TileID = 0, WallID = 0;
public short TileX = 0, TileY = 0;
public byte LiquidID = 0, LiquidValue = 0;
public TileInfo(Color Code)
{
this.Code = Code;
}
public TileInfo(byte CodeR, byte CodeG, byte CodeB, byte CodeA = 255)
{
this.Code = new Color(CodeR, CodeG, CodeB, CodeA);
}
public bool IsSameColor(Color color)
{
return Code.R == color.R && Code.G == color.G && Code.B == color.B && Code.A == color.A;
}
public TileInfo SetTile(ushort TileID, short TileX = 0, short TileY = 0)
{
this.TileID = TileID;
this.TileX = TileX;
this.TileY = TileY;
Active = true;
return this;
}
public TileInfo SetWall(ushort WallID)
{
this.WallID = WallID;
return this;
}
public TileInfo SetLiquid(byte LiquidType, byte LiquidValue)
{
this.LiquidID = LiquidType;
if (LiquidValue > 100) LiquidValue = 100;
this.LiquidValue = LiquidValue;
return this;
}
public const int Type_Solid = 0;
public const int Type_Halfbrick = 1;
public const int Type_SlopeDownRight = 2;
public const int Type_SlopeDownLeft = 3;
public const int Type_SlopeUpRight = 4;
public const int Type_SlopeUpLeft = 5;
public const int Liquid_Water = 0;
public const int Liquid_Lava = 1;
public const int Liquid_Honey = 2;
}
}