ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/kgsueme/bin/kgsueme
Revision: 1.64
Committed: Thu Jun 3 03:46:21 2004 UTC (19 years, 11 months ago) by root
Branch: MAIN
Changes since 1.63: +6 -0 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 pcg 1.25 #!/usr/bin/perl
2 pcg 1.1
3 pcg 1.32 use Glib;
4     use Gtk2;
5 pcg 1.1
6     use KGS::Protocol;
7     use KGS::Listener::Debug;
8    
9 pcg 1.16 use Audio::Data;
10     use Audio::Play;
11    
12 pcg 1.1 use IO::Socket::INET;
13 pcg 1.25 use List::Util;
14 pcg 1.1 use Errno;
15    
16 pcg 1.32 use Storable;
17 pcg 1.40 use Carp;
18 pcg 1.32
19     init Gtk2;
20 pcg 1.40
21     $SIG{QUIT} = sub { Carp::confess "SIGQUIT" };
22 pcg 1.1
23 pcg 1.26 our $HACK = 1; # do NEVER enable. ;)
24 pcg 1.29 our $DEBUG_EXPOSE = 0;
25 pcg 1.3
26 pcg 1.25 if ($HACK) {
27     $KGS::debug = 1;
28     }
29    
30 pcg 1.45 BEGIN {
31     our $VERSION = "0.1";
32 pcg 1.26
33 pcg 1.45 our $config;
34     our $LIBDIR = ".";
35 pcg 1.55
36     use KGS::Constants;
37 pcg 1.7
38 root 1.63 for (qw(util.pl gtk.pl chat.pl sound.pl user.pl gamelist.pl userlist.pl
39 pcg 1.55 game.pl room.pl roomlist.pl app.pl)) {
40     require (KGS::Constants::findfile "KGS/kgsueme/$_");
41     die if $@;
42 pcg 1.45 }
43 pcg 1.7 }
44    
45 pcg 1.59 if ($ENV{KGSUEME_DEBUG}) {
46 pcg 1.17 use KGS::Constants;
47    
48 root 1.64 my $window = new Gtk2::Window 'toplevel';
49     $window->add (new game::userpanel colour => 0);
50     $window->show_all;
51    
52     main Gtk2;
53    
54 pcg 1.25 for (19) {
55 pcg 1.52 my $game = new game size => $_;
56 pcg 1.60
57     $game->event_challenge (
58     bless( {
59     type => 0,
60 pcg 1.61 black => bless( {
61 pcg 1.60 flags => 2633,
62     name => 'dorkusx'
63     }, 'KGS::User' ),
64     rules => bless( {
65     count => 5,
66     time => 900,
67     timesys => 2,
68     interval => 30,
69     komi => '6.5',
70     size => 19,
71     ruleset => 0,
72     handicap => 2,
73     }, 'KGS::Rules' ),
74 pcg 1.61 white => bless( {
75 pcg 1.60 flags => 436220808,
76     name => 'Nerdamus'
77     }, 'KGS::User' )
78     }, 'KGS::Challenge' ));
79    
80 pcg 1.52
81 pcg 1.60 if (0) {
82 pcg 1.56 my $data = Storable::retrieve "board2.dat";
83 pcg 1.52 while (my ($k, $v) = each %$data) {
84     $game->{$k} = $v;
85     }
86     $game->event_update_tree;
87     }
88 pcg 1.26
89 pcg 1.52 if (0) {
90     $game->{cur_board} = new KGS::Game::Board;
91 pcg 1.47 my @x = (
92     #MARK_B,
93     #MARK_W,
94     #MARK_GRAY_B | MARK_SMALL_W,
95     #MARK_GRAY_W | MARK_SMALL_B,
96     #MARK_W | MARK_TRIANGLE,
97     0, 0, 0,
98     );
99     for $x (0..18) {
100     for $y (0..18) {
101 pcg 1.52 $game->{cur_board}{board}[$x][$y] =
102 pcg 1.47 $x[rand @x];
103     }
104     }
105    
106 pcg 1.52 $game->{cur_board}{board}[0][0] = MARK_B;
107     $game->{cur_board}{board}[1][1] = MARK_GRAY_B | MARK_SMALL_W;
108     $game->{cur_board}{board}[2][2] = MARK_W | MARK_TRIANGLE;
109     $game->{cur_board}{board}[1][2] = MARK_B | MARK_LABEL;
110     $game->{cur_board}{label}[1][2] = "198";
111     $game->{cur_board}{board}[0][2] = MARK_W | MARK_LABEL;
112     $game->{cur_board}{label}[0][2] = "AWA";
113     $game->{board}->set_board ($game->{cur_board});
114 pcg 1.26 }
115 pcg 1.25 }
116 pcg 1.60 main Gtk2;
117    
118 pcg 1.12 }
119    
120 pcg 1.59 our $app = new app;
121    
122 pcg 1.32 main Gtk2;
123 pcg 1.1
124 pcg 1.50 $app->destroy;
125 pcg 1.34
126     Gtk2->main_iteration while Gtk2->events_pending;
127    
128     1;
129 pcg 1.1
130