Diff
Not logged in

Differences From Artifact [7fa423ba9f8ebe92]:

To Artifact [3f9e2911ee63dc4e]:


1 1 import util; 2 2 import game; 3 3 import driver; 4 4 import core.stdc.signal; 5 5 6 6 class NilOutput : GameObserver 7 7 { 8 - this(const(Game) g) {} 9 - override void on_game_changed(char c, const(Game) g, bool finished) {} 8 + this(in Game g) {} 9 + override void on_game_changed(char c, in Game g, bool finished) {} 10 10 } 11 11 12 12 class StdOutput : GameObserver 13 13 { 14 - this(const(Game) g) {} 15 - override void on_game_changed(char c, const(Game) g, bool finished) 14 + this(in Game g) {} 15 + override void on_game_changed(char c, in Game g, bool finished) 16 16 { 17 17 stdout.write(c); 18 18 stdout.flush(); 19 19 } 20 20 } 21 21 22 22 class GuardedOutput : GameObserver 23 23 { 24 - this(const(Game) g) 24 + this(in Game g) 25 25 { 26 26 setup_sigint_handling(); 27 27 ideal_log ~= g.score_if_abort_now; 28 28 } 29 29 30 - override void on_game_changed(char c, const(Game) g, bool finished) 30 + override void on_game_changed(char c, in Game g, bool finished) 31 31 { 32 32 log ~= c; 33 33 score_log ~= g.score; 34 34 ideal_log ~= g.score_if_abort_now; 35 35 if(finished) 36 36 flush(); 37 37 }