-
Notifications
You must be signed in to change notification settings - Fork 0
/
Master.cs
53 lines (45 loc) · 926 Bytes
/
Master.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
using Godot;
using System;
public partial class Master : VBoxContainer
{
private Game _gameNode;
// Called when the node enters the scene tree for the first time.
public override void _Ready()
{
_gameNode = (Game)GetNode<Control>("Game");
}
// Called every frame. 'delta' is the elapsed time since the previous frame.
public override void _Process(double delta)
{
}
private void OnStartGamePressed()
{
_gameNode.InitGame();
}
// False = Black, True = White
private void OnFirstMoveToggled(bool toggled_on)
{
if (_gameNode.GameStarted)
{
return;
}
if (toggled_on)
{
_gameNode.Turn = 1;
}
else
{
_gameNode.Turn = -1;
}
}
// False = Human, True = AI
private void OnBlackPlayerToggled(bool toggled_on)
{
_gameNode.BlackPlayer = toggled_on;
}
// False = Human, True = AI
private void OnWhitePlayerToggled(bool toggled_on)
{
_gameNode.WhitePlayer = toggled_on;
}
}