11///<reference path="Driver.ts"/>
22
3- module Mankala {
3+ namespace Mankala {
44 export var NoSpace = - 1 ;
55 export var homeSpaces = [ [ 0 , 1 , 2 , 3 , 4 , 5 ] ,
66 [ 7 , 8 , 9 , 10 , 11 , 12 ] ] ;
@@ -14,18 +14,12 @@ module Mankala {
1414 const humanScoreId = "humanScore" ;
1515 const computerScoreId = "computerScore"
1616
17- export interface IPositionList extends Base . IList {
18- data : Position ;
19- push ( pos : Position ) ;
20- pop ( ) : Position ;
21- }
22-
23- function pushPosition ( pos : Position , l : IPositionList ) {
17+ function pushPosition ( pos : Position , l : Base . IList < Position > ) {
2418 l . insertAfter ( Base . listMakeEntry ( pos ) ) ;
2519 }
2620
27- function popPosition ( l : IPositionList ) {
28- var entry : IPositionList = < IPositionList > Base . listRemove ( l . next ) ;
21+ function popPosition ( l : Base . IList < Position > ) {
22+ var entry = Base . listRemove ( l . next ) ;
2923 if ( entry != null ) {
3024 return entry . data ;
3125 } else {
@@ -43,7 +37,7 @@ module Mankala {
4337 export class Game {
4438 private position = new DisplayPosition ( [ 3 , 3 , 3 , 3 , 3 , 3 , 0 , 3 , 3 , 3 , 3 , 3 , 3 , 0 ] , NoMove , 0 ) ;
4539 private prevConfig : SeedCoords [ ] [ ] ;
46- private q : IPositionList = null ;
40+ private q : Base . IList < Position > = null ;
4741 private scores : number [ ] = null ;
4842 private positionCount = 0 ;
4943 private moveCount = 0 ;
@@ -165,7 +159,7 @@ module Mankala {
165159
166160 private findMove ( ) {
167161 var timeStart = new Date ( ) . getTime ( ) ;
168- this . q = < IPositionList > Base . listMakeHead ( ) ;
162+ this . q = Base . listMakeHead < Position > ( ) ;
169163 this . scores = [ NoScore , NoScore , NoScore , NoScore , NoScore , NoScore ] ;
170164 pushPosition ( this . position , this . q ) ;
171165 var deltaTime = 0 ;
0 commit comments