Overview
SHA1 Hash: | aea6cfc7e34b68c61540a776c0cde4c8c28fa08e |
---|---|
Date: | 2012-07-14 23:33:25 |
User: | kinaba |
Comment: | further clean up. |
Timelines: | family | ancestors | descendants | both | trunk |
Diffs: | redesign |
Downloads: | Tarball | ZIP archive |
Other Links: | files | file ages | manifest |
Tags And Properties
- branch=trunk inherited from [16f0b5784f]
- sym-trunk inherited from [16f0b5784f]
Changes
Modified src/cui_auto_main.d from [d3f73764386d7688] to [8844bb07a00188c5].
5 5 import solver; 6 6 7 7 class CUI(Solver) : GameObserver 8 8 { 9 9 this(in Game g) { solver = new Solver(g); } 10 10 Solver solver; 11 11 bool fin; 12 - override void on_game_changed(char c, const(Game) g, bool finished) 12 + override void on_game_changed(char c, in Game g, bool finished) 13 13 { 14 14 fin = finished; 15 15 } 16 16 } 17 17 18 18 void main(string[] args) 19 19 { 20 20 Driver d = new Driver(stdin); 21 21 d.addObserver!(GuardedOutput)(); 22 22 auto c = d.addObserver!(CUI!Solver_1)(); 23 23 while(!c.fin) 24 24 d.command(c.solver.single_step()); 25 25 }
Modified src/gui.d from [f5e549c65e603be1] to [e185ff3281d95738].
27 27 }; 28 28 t.start(); 29 29 this.closing ~= (Form f,CancelEventArgs c){t.stop();}; 30 30 } 31 31 Application.run(this); 32 32 } 33 33 34 - override void on_game_changed(char c, const(Game) g, bool finished) 34 + override void on_game_changed(char c, in Game g, bool finished) 35 35 { 36 36 draw(g); 37 37 } 38 38 39 39 private: 40 40 int cell; 41 41 ................................................................................ 77 77 this.render['L'] = "☒"; 78 78 this.render['O'] = "☐"; 79 79 this.paint ~= (Control c, PaintEventArgs ev) { 80 80 graphicContext.copyTo(ev.graphics, Rect(0,0,this.clientSize.width,this.clientSize.height)); 81 81 }; 82 82 } 83 83 84 - void draw(const(Game) g) 84 + void draw(in Game g) 85 85 { 86 86 int scrW = this.clientSize.width; 87 87 int scrH = this.clientSize.height; 88 88 89 89 // Fill bg. 90 90 graphicContext.fillRectangle(this.backColor, Rect(0,0,scrW,scrH)); 91 91
Modified src/solver.d from [ee353f733f706a26] to [6a465bd844fac2d9].
1 1 import util; 2 2 import game; 3 -import driver; 4 - 5 -/* 6 -interface Solver 7 -{ 8 - this(const(Game) g); 9 - char single_step(); 10 -} 11 -*/ 12 3 13 4 class Solver_0 14 5 { 15 6 this(const(Game) g) {} 16 7 char single_step() { return 'W'; } 17 8 } 18 9