コード例 #1
0
ファイル: ImmutableGame.cs プロジェクト: andobr/puzzle15
        protected override Game Replace(int value)
        {
            var game = new ImmutableGame(this);

            game.field.valuesByPoint[GetLocation(value)] = 0;
            game.field.valuesByPoint[GetLocation(0)]     = value;

            game.field.pointsByValue[0]     = GetLocation(value);
            game.field.pointsByValue[value] = GetLocation(0);

            return(game);
        }
コード例 #2
0
ファイル: ImmutableGame.cs プロジェクト: andobr/puzzle15
 private ImmutableGame(ImmutableGame game)
 {
     size  = game.size;
     field = new Field(game.field);
 }