forked from microsoft/TypeScriptSamples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFeatures.ts
More file actions
29 lines (26 loc) · 870 Bytes
/
Features.ts
File metadata and controls
29 lines (26 loc) · 870 Bytes
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
///<reference path="Driver.ts"/>
namespace Mankala {
export class Features {
public turnContinues = false;
public seedStoredCount = 0;
public capturedCount = 0;
public spaceCaptured = NoSpace;
public clear() {
this.turnContinues = false;
this.seedStoredCount = 0;
this.capturedCount = 0;
this.spaceCaptured = NoSpace;
}
public toString() {
var stringBuilder = "";
if (this.turnContinues) {
stringBuilder += " turn continues,";
}
stringBuilder += " stores " + this.seedStoredCount;
if (this.capturedCount > 0) {
stringBuilder += " captures " + this.capturedCount + " from space " + this.spaceCaptured;
}
return stringBuilder;
}
}
}