-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMapInspector.cs
36 lines (34 loc) · 1.1 KB
/
MapInspector.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
using System;
namespace Roguelike
{
class MapInspector : BaseCharacter
{
public bool IsInspect { get; set; }
public MapInspector(string name, Point coords)
{
Name = name;
Coords = coords;
PrevCoords = new Point();
}
public override void Move()
{
int mapHeight = Program.GameEngine.GetMapHeight();
int mapWidth = Program.GameEngine.GetMapWidth();
switch (CurrentMoveAction)
{
case MoveAction.Up:
if (Coords.Y - 1 >= 0) SetPrevPlusMove(MoveAction.Up);
break;
case MoveAction.Down:
if (Coords.Y + 1 < mapHeight) SetPrevPlusMove(MoveAction.Down);
break;
case MoveAction.Left:
if (Coords.X > 0) SetPrevPlusMove(MoveAction.Left);
break;
case MoveAction.Right:
if (Coords.X < mapWidth - 1) SetPrevPlusMove(MoveAction.Right);
break;
}
}
}
}