Commit 966ea6bc authored by mercury233's avatar mercury233

add MSG_ANNOUNCE_CARD_FILTER and MSG_ROCK_PAPER_SCISSORS

parent d9a9b49a
...@@ -118,6 +118,8 @@ namespace WindBot.Game ...@@ -118,6 +118,8 @@ namespace WindBot.Game
_messages.Add(GameMessage.AnnounceCard, OnAnnounceCard); _messages.Add(GameMessage.AnnounceCard, OnAnnounceCard);
_messages.Add(GameMessage.AnnounceNumber, OnAnnounceNumber); _messages.Add(GameMessage.AnnounceNumber, OnAnnounceNumber);
_messages.Add(GameMessage.AnnounceRace, OnAnnounceRace); _messages.Add(GameMessage.AnnounceRace, OnAnnounceRace);
_messages.Add(GameMessage.AnnounceCardFilter, OnAnnounceCard);
_messages.Add(GameMessage.RockPaperScissors, OnRockPaperScissors);
} }
private void OnJoinGame(BinaryReader packet) private void OnJoinGame(BinaryReader packet)
...@@ -1085,6 +1087,7 @@ namespace WindBot.Game ...@@ -1085,6 +1087,7 @@ namespace WindBot.Game
private void OnAnnounceCard(BinaryReader packet) private void OnAnnounceCard(BinaryReader packet)
{ {
// not fully implemented
Connection.Send(CtosMessage.Response, _ai.OnAnnounceCard()); Connection.Send(CtosMessage.Response, _ai.OnAnnounceCard());
} }
...@@ -1117,5 +1120,16 @@ namespace WindBot.Game ...@@ -1117,5 +1120,16 @@ namespace WindBot.Game
reply += (int)races[i]; reply += (int)races[i];
Connection.Send(CtosMessage.Response, reply); Connection.Send(CtosMessage.Response, reply);
} }
private void OnRockPaperScissors(BinaryReader packet)
{
packet.ReadByte(); // player
int result;
if (_hand > 0)
result = _hand;
else
result = _ai.OnRockPaperScissors();
Connection.Send(CtosMessage.Response, result);
}
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment