Skip to content

Commit 41aeb2b

Browse files
committed
added the move history
1 parent 06c85dc commit 41aeb2b

29 files changed

+233
-167
lines changed

Chess/ChessboardComponent.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div *ng-for="#row of fields; var rowindex=index" style="width: 630px; height: 62px; overflow: hidden;" >
1+
<div *ng-for="#row of fields; var rowindex=index" style="width: 630px; height: 52px; overflow: hidden;" >
22
<field *ng-for="#col of row; var colindex=index" [row]=rowindex [col]=colindex [piece]=col >
33
</div>
44
</div>

Chess/FieldComponent.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
<div style="position: relative; left: 0px; top: 0px; width: 64px; height: 64px;margin-right:-6px; margin-bottom:-6px; display: inline-block" >
1+
<div style="position: relative; left: 0px; top: 0px; width: 54px; height: 54px;margin-right:-6px; margin-bottom:-6px; display: inline-block" >
22
<div style="position: relative; top: 0px; left: 0px" >
33
<img class="{{borderClass(row,col)}}" src="{{backgroundFileName(row,col)}}" />
44
</div>
55
<div style="position: absolute; top: 0px; left: 0px;">
6-
<img style="width:62px;height:62px" src="{{fileName(piece)}}"
6+
<img style="width:52px;height:52px" src="{{fileName(piece)}}"
77
(dragstart)="ondragstart(row, col)"
88
(dragover)="ondragover(row, col)"
99
(drop)="ondragdrop(row, col)"

Chess/HistoryComponent.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
In a future version, this will show the move history.
1+
<div style="height:520px;overflow-y:auto;width:180px" class="row">
2+
<div *ng-for="#move of moveHistory();" class="col-md-6">
3+
{{move}}
4+
</div>
5+
</div>

Chess/applicationcomponent.js

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Chess/applicationcomponent.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Chess/applicationcomponent.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@
33
import {Component, View, bootstrap} from 'angular2/angular2';
44
import {ChessBoardComponent} from "./chessboardcomponent";
55
import {CapturedPiecesComponent} from './capturedpiecescomponent';
6-
import {Engine} from "./engine/chessboard";
6+
import {ChessEngineAPI} from "./engine/chessboardUI";
77
import {HistoryComponent} from './historycomponent';
88

99
// Annotation section
1010
@Component({
1111
selector: 'application',
12-
bindings: [Engine.ChessboardUI]
12+
bindings: [ChessEngineAPI.ChessboardUI]
1313
})
1414
@View({
1515
templateUrl: 'ApplicationComponent.html',
1616
directives: [ChessBoardComponent, HistoryComponent, CapturedPiecesComponent]
1717
})
1818
// Component controller
1919
class ApplicationComponent {
20-
constructor(private chessboard:Engine.ChessboardUI) {}
20+
constructor(private chessboard:ChessEngineAPI.ChessboardUI) {}
2121

2222
public get title(): String { return this.chessboard.isWhitePlaying?"White move":"Black move"}
2323
}

Chess/capturedpiecescomponent.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Chess/capturedpiecescomponent.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Chess/capturedpiecescomponent.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/// <reference path="typings/angular2/angular2.d.ts" />
22
import {Component, View, NgFor, bootstrap, Query, QueryList} from 'angular2/angular2';
3-
import {Engine} from './engine/chessboard';
3+
import {ChessEngineAPI} from './engine/chessboardUI';
44
import {PieceModule} from './engine/pieces'
55

66
@Component({
@@ -12,7 +12,7 @@ import {PieceModule} from './engine/pieces'
1212
})
1313
export class CapturedPiecesComponent {
1414

15-
constructor(private chessboard:Engine.ChessboardUI) {}
15+
constructor(private chessboard:ChessEngineAPI.ChessboardUI) {}
1616

1717
capturedPiecesFilenames(): Array<string> {
1818
var sorted: Array<number> = this.chessboard.capturedPieces.sort((n1,n2)=> this.isBefore(n1, n2))

Chess/chess.css

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
.field {
22
border: 1px solid black;
3-
width:63px;height:63px;
3+
width:53px;height:53px;
44
}
55

66
.selectedField {
77
border: 2px solid blue;
8-
width:62px;
9-
height:62px;
8+
width:52px;
9+
height:52px;
1010
top:0px;
1111
position:relative;
1212
}
1313

1414
.fieldInReach {
1515
border: 2px solid #64CE64;
16-
width:62px;
17-
height:62px;
16+
width:52px;
17+
height:52px;
1818
top:0px;
1919
position:relative;
2020
}

Chess/chessboardcomponent.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Chess/chessboardcomponent.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Chess/chessboardcomponent.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/// <reference path="typings/angular2/angular2.d.ts" />
22
import {Component, View, NgFor, bootstrap, Query, QueryList} from 'angular2/angular2';
33
import {FieldComponent} from './fieldcomponent';
4-
import {Engine} from './engine/chessboard';
4+
import {ChessEngineAPI} from './engine/chessboardUI';
55

66
@Component({
77
selector: 'chessboard'
@@ -12,9 +12,9 @@ import {Engine} from './engine/chessboard';
1212
templateUrl: 'ChessboardComponent.html'
1313
})
1414
export class ChessBoardComponent {
15-
get board(): Engine.ChessboardUI { return this.chessboard }
15+
get board(): ChessEngineAPI.ChessboardUI { return this.chessboard }
1616

1717
get fields() { return this.board.fields }
1818

19-
constructor(private chessboard:Engine.ChessboardUI) {}
19+
constructor(private chessboard:ChessEngineAPI.ChessboardUI) {}
2020
}

Chess/engine/chessboard.js

+2-71
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)