-
Notifications
You must be signed in to change notification settings - Fork 0
/
MapTip.cs
74 lines (71 loc) · 2.84 KB
/
MapTip.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace _2016RPGBase
{
class MapTip : asd.Chip2D
{
public enum Type
{
Ground,
Wall,
Event
}
public MapTip(System.Drawing.Color color, asd.Vector2DF pos, Scene.Field.Data data)
{
Texture = Resource.CharactorGraph;
if (color.R == 255)
{
type = Type.Wall;
if (color.G == 0 && color.B == 0)
Src = Resource.GraphSrc(Resource.GraphType.Wall);
else if (color.G == 100 && color.B == 0)
Src = Resource.GraphSrc(Resource.GraphType.Block);
else if (color.G == 150 && color.B == 0)
Src = Resource.GraphSrc(Resource.GraphType.Table);
if (color.B == 200)
{
if (color.G == 40)
Src = Resource.GraphSrc(Resource.GraphType.PartitionVertical);
else if (color.G == 80)
Src = Resource.GraphSrc(Resource.GraphType.PatitionHorizontal);
else if (color.G == 120)
Src = Resource.GraphSrc(Resource.GraphType.PartitionLeftTop);
else if (color.G == 160)
Src = Resource.GraphSrc(Resource.GraphType.PartitionRightTop);
else if (color.G == 200)
Src = Resource.GraphSrc(Resource.GraphType.PartitionLeftBottom);
else if (color.G == 240)
Src = Resource.GraphSrc(Resource.GraphType.PartitionRightBottom);
}
}
else if (color.G == 255)
{
type = Type.Ground;
if (color.R == 0 && color.B == 0)
Src = Resource.GraphSrc(Resource.GraphType.Ground);
else if (color.R == 200 && color.B == 0)
Src = Resource.GraphSrc(Resource.GraphType.Step);
else if (color.R == 0 && color.B == 100)
Src = Resource.GraphSrc(Resource.GraphType.Person);
else if (color.R == 100 && color.B == 100)
{
Src = Resource.GraphSrc(Resource.GraphType.Ground);
data.Player.Position = pos;
}
}
else if (color.B == 255)
{
type = Type.Event;
if (color.G == 0 && color.R == 0)
Src = Resource.GraphSrc(Resource.GraphType.Ground);
else if (color.G == 100 && color.R == 0)
Src = Resource.GraphSrc(Resource.GraphType.Table);
}
Position = pos;
}
public Type type { get; set; } = Type.Ground;
}
}