nicer description file

This commit is contained in:
Max-Wilhelm Bruker 2009-10-26 16:01:26 +01:00
parent ad47988d91
commit 3461b60183
3 changed files with 35 additions and 33 deletions

View file

@ -125,7 +125,7 @@ Command_MoveCard::Command_MoveCard(int _gameId, const QString &_startZone, int _
setParameter("target_zone", targetZone);
setParameter("x", x);
setParameter("y", y);
setParameter("faceDown", faceDown);
setParameter("face_down", faceDown);
}
void Command_MoveCard::extractParameters()
{
@ -135,7 +135,7 @@ void Command_MoveCard::extractParameters()
targetZone = parameters["target_zone"];
x = parameters["x"].toInt();
y = parameters["y"].toInt();
faceDown = (parameters["faceDown"] == "1");
faceDown = (parameters["face_down"] == "1");
}
Command_CreateToken::Command_CreateToken(int _gameId, const QString &_zone, const QString &_name, const QString &_pt, int _x, int _y)
: GameCommand("create_token", _gameId), zone(_zone), name(_name), pt(_pt), x(_x), y(_y)

View file

@ -1,30 +1,30 @@
0:ping:Ping
0:login:Login:s,username:s,password
0:chat_list_channels:ChatListChannels
0:chat_join_channel:ChatJoinChannel:s,channel
1:chat_leave_channel:ChatLeaveChannel
1:chat_say:ChatSay:s,message
0:list_games:ListGames
0:create_game:CreateGame:s,description:s,password:i,max_players:b,spectators_allowed
0:join_game:JoinGame:i,game_id:s,password:b,spectator
2:leave_game:LeaveGame
2:say:Say:s,message
2:shuffle:Shuffle
2:roll_die:RollDie:i,sides
2:draw_cards:DrawCards:i,number
2:move_card:MoveCard:s,start_zone:i,card_id:s,target_zone:i,x:i,y:b,faceDown
2:create_token:CreateToken:s,zone:s,name:s,pt:i,x:i,y
2:create_arrow:CreateArrow:i,start_player_id:s,start_zone:i,start_card_id:i,target_player_id:s,target_player_zone:i,target_card_id:i,color
2:delete_arrow:DeleteArrow:i,arrow_id
2:set_card_attr:SetCardAttr:s,zone:i,card_id:s,attr_name:s,attr_value
2:ready_start:ReadyStart
2:inc_counter:IncCounter:i,counter_id:i,delta
2:add_counter:AddCounter:s,counter_name:i,color:i,radius:i,value
2:set_counter:SetCounter:i,counter_id:i,value
2:del_counter:DelCounter:i,counter_id
2:next_turn:NextTurn
2:set_active_phase:SetActivePhase:i,phase
2:dump_zone:DumpZone:i,player_id:s,zone_name:i,number_cards
2:stop_dump_zone:StopDumpZone:i,player_id:s,zone_name
2:dump_all:DumpAll
2:submit_deck:SubmitDeck
0:ping
0:login:s,username:s,password
0:chat_list_channels
0:chat_join_channel:s,channel
1:chat_leave_channel
1:chat_say:s,message
0:list_games
0:create_game:s,description:s,password:i,max_players:b,spectators_allowed
0:join_game:i,game_id:s,password:b,spectator
2:leave_game
2:say:s,message
2:shuffle
2:roll_die:i,sides
2:draw_cards:i,number
2:move_card:s,start_zone:i,card_id:s,target_zone:i,x:i,y:b,face_down
2:create_token:s,zone:s,name:s,pt:i,x:i,y
2:create_arrow:i,start_player_id:s,start_zone:i,start_card_id:i,target_player_id:s,target_player_zone:i,target_card_id:i,color
2:delete_arrow:i,arrow_id
2:set_card_attr:s,zone:i,card_id:s,attr_name:s,attr_value
2:ready_start
2:inc_counter:i,counter_id:i,delta
2:add_counter:s,counter_name:i,color:i,radius:i,value
2:set_counter:i,counter_id:i,value
2:del_counter:i,counter_id
2:next_turn
2:set_active_phase:i,phase
2:dump_zone:i,player_id:s,zone_name:i,number_cards
2:stop_dump_zone:i,player_id:s,zone_name
2:dump_all
2:submit_deck

View file

@ -17,6 +17,8 @@ while (<file>) {
@line = split(/:/);
$type = shift(@line);
$name1 = shift(@line);
($name2 = $name1) =~ s/_(.)/\U$1\E/g;
$name2 =~ s/^(.)/\U$1\E/;
if ($type == 0) {
$baseClass = 'Command';
$parentConstructorCall = "$baseClass(\"$name1\")";
@ -34,7 +36,7 @@ while (<file>) {
$constructorParamsCpp = "int _gameId";
}
$className = 'Command_' . shift(@line);
$className = 'Command_' . $name2;
print headerfile "class $className : public $baseClass {\n"
. "\tQ_OBJECT\n"
. "private:\n";