-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFigura.cs
88 lines (58 loc) · 1.89 KB
/
Figura.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
using System;
using System.Collections.Generic;
using System.Text;
namespace Les_5._View_2
{
abstract class Figura
{
enum PlayerTypes
{
King = 1,
Queen = 2
}
#region Fields
public byte figure_number;
public byte type;
public byte cursor_Width;
public byte cursor_Height;
public bool blue_red;
public bool life;
#region For king
protected bool Up;
protected bool Down;
protected bool Left;
protected bool Right;
#endregion
#region For Queen
protected bool up_Left;
protected bool up_Right;
protected bool down_Left;
protected bool down_Right;
#endregion
#endregion
#region Construction
public Figura(byte Figure_Number,byte Cursor_Width, byte Cursor_Height, bool Blue_red)
{
figure_number = Figure_Number;
cursor_Width = Cursor_Width;
cursor_Height = Cursor_Height;
blue_red = Blue_red;
life = true;
}
#endregion
#region Methods
public abstract void Move(byte Board_width, byte Board_height, List<Figura> Players_allies, Board board, List<Figura> Enemy_players);
public abstract bool Availabe_Move(byte Board_width, byte Board_height, List<Figura> Players_allies, Board board, byte mode);
protected void Check_Enemy_On_Player_Position(List<Figura> Enemy_players)
{
foreach(Figura player in Enemy_players)
{
if(player.cursor_Height == cursor_Height && player.cursor_Width == cursor_Width)
{
player.life = false;
}
}
}
#endregion
}
}