symlink cleanup
[aymargeddon/current.git] / src / test.pl
1 use FROGS::DataBase;
2 # use Aymargeddon;
3 # use DBI;
4 use strict;
5 use Data::Dumper;
6 use Date::Calc qw(Time_to_Date);
7
8 use FROGS::Command;
9
10 use FROGS::Config qw($conf);
11
12 $| = 1;
13
14 my $d = DataBase->new();
15 # $d->nowrite();
16
17 my $dbhash =
18 #  {'LOCATION' => '2_0',
19 #   'COMMAND' => 'BUILD_TEMPLE',
20 #   'ARGUMENTS' => 'MOBILE=1',
21 #   'PLAYER' => 1,
22 #   'GAME' => 1,
23 #   'ID' => 1007
24 #  };
25   {'LOCATION' => '11_3',
26    'COMMAND' => 'PRODUCE',
27    'ARGUMENTS' => 'ROLE=-1',
28    'PLAYER' => -1,
29    'GAME' => 4,
30    'ID' => 1007,
31   };
32
33
34 # print Dumper $dbhash;
35
36 require "AymCommand.pm";
37
38 my $c = $dbhash->{'COMMAND'}->new($dbhash,$d);
39
40 # print "is valid\n" if $c->is_valid();
41 $c->{-phase} = 1;
42 my $fp = $c->first_phase();
43
44 if ($fp){
45   print "first phase correct. duration: $c->{-duration}\n";
46   $c->{-phase} = 2;
47   print "second phase correct\n" if $c->second_phase();
48 }else{
49   print "no second phase\n";
50 }
51
52 $d->commit();
53
54 # $d->{-dbh}->disconnect();
55
56 # print Dumper $c;
57
58
59
60
61
62