-
Notifications
You must be signed in to change notification settings - Fork 1
CardGameResources Library Documentation
Card | Deck |
TrumpInfos | Envcall |
EnvInfos | Err |
Errcall | GameAction |
Gamecall | Packet |
PacketType | Syscall |
SysCommand |
Class used to define a Card object.
Main constructor for a Card
Name | Description |
---|---|
v |
System.Char The value of the card |
c |
System.String The color of the card |
Getter and Setter for the color of the Card
Getter and Setter for the value of the Card.
Class used to store and manipulate one or multiples Card
Default constructor for Deck
Second constructor for Deck. It allow to fill directly the Deck with some Card.
Name | Description |
---|---|
array_ |
System.Collections.Generic.List{CardGameResources.Game.Card} The List of Card which will be copied into the Deck |
Name | Description |
---|---|
card_ |
CardGameResources.Game.Card The Card which will be append to thee Deck |
This method always returns true
Getter and Setter for the List of Card contained in the Deck
Remove all the Card objects in the Deck
Check if a Card is in the Deck
Name | Description |
---|---|
card |
CardGameResources.Game.Card The Card used for the search |
True if the Card is contained in the Deck, false otherwise.
Remove a specific Card from the Deck
Name | Description |
---|---|
card |
CardGameResources.Game.Card The Card which will be removed |
Remove a Card by its index in the Deck
Name | Description |
---|---|
index |
System.Int32 The index of the Card |
False if the index is greater than the number of cards in the Deck, true otherwise.
TrumpInfos is a class used to store information about a trump in a card game.
Default constructor for TrumpInfos
Complete constructor for TrumpInfos
Name | Description |
---|---|
card_ |
CardGameResources.Game.Card The card which will be stored as the trump |
owner_ |
System.String The name of the player which took the Trump |
realColor_ |
System.String The real color of the Trump. It can differ from the Card color |
Constructor which take a Card in parameter
Name | Description |
---|---|
card_ |
CardGameResources.Game.Card The TrumpInfos.Card associated to the trump, the color of the card may differs from the real trump color |
Getter and Setter for the Card
Getter and Setter for the Owner of the trump Card
Getter and Setter for the trump real color
This class have to be used as the System.Object parameter for a Packet with a PacketType of value PacketType.ENV.
Complete constructor for Envcall
Getter and Setter for the data System.Object of the Envcall
Getter and Setter for the type of the Envcall
Enum for the ENV part of the communication protocol.
Communication direction: Server => Client.
Give to the client the scores for the two teams.
The object associated with the command must a List of integer of size 2
Communication direction: Server => Client.
Give to the client the remaining time before the end of the round.
The object associated with the command must a System.Int32
Communication direction: Server => Client.
Give to the client the information about the teams' composition.
The object associated with the command must a Dictionary which link a player name with its team number
Communication direction: Server => Client.
Give to the clients the name of the current player.
The object associated to the command must be a System.String
Communication direction: Server => Client.
Give to the client the list of connected users
The object associated to the command must a List of string of size 1 to 4
Enum for the ERROR part of the communication protocol.
Communication direction: Server => Client.
Inform the client that the server has received a bad argument on one of the client's request.
The object associated with the command must be null
Communication direction: Server => Client.
Inform the client that he broke a rule by one of its action.
The object associated with the command must be null
Communication direction: Server => Client.
Inform the client that the action he did was not allowed.
The object associated with the command must be null
Communication direction: Server => Client.
Inform the client that the card he played was not valid.
The object associated with the command must be null
Communication direction: Server => Client.
Inform the client that he can't register to the server because it has no remaining slot.
The object associated with the command must be null
Communication direction: Server => Client.
Inform the client that an unexpected error has been thrown on the server.
The object associated with the command must be null
This class have to be used as the System.Object parameter for a Packet with a PacketType of value PacketType.ERR.
Default constructor for Errcall
Complete constructor for Errcall
Constructor with type defined only for Errcall
Getter and Setter for the data System.Object of the Errcall
Getter and Setter for the type of the Errcall
Enum for the GAME part of the communication protocol.
Communication direction: Client => Server.
Inform the server that the client want to play a specific CardGameResources.Game.Card of its CardGameResources.Game.Deck.
The object associated to the command must be a CardGameResources.Game.Card
Communication direction: Client => Server.
This is the answer to the first lap of the trump phase.
The client uses this command to inform if want (or not) to take the trump.
The object associated with the command must be a System.Boolean
Communication direction: Client => Server.
This is the answer to the second lap of the trump phase.
The client uses this command to inform if want (or not) to take the trump as the color of its choice.
The object associated with the command must be a System.String (either empty or with the name of the wanted color)
Communication direction: Server => Client.
The server uses this command to ask if a client wants to take the trump or not.
Following the lap number (1 or 2), the answer might be either GameAction.C_TAKE_TRUMP or GameAction.C_TAKE_TRUMP_AS.
The object associated with the command must be a KeyValuePair(int, string) where the key is the lap number and the string the player targeted.
Communication direction: Server => Client.
The server use this command to send the updated board CardGameResources.Game.Deck.
The object associated to the command must be a CardGameResources.Game.Deck.
Communication direction: Server => Client.
The server uses this command to send the updated CardGameResources.Game.Deck for the last played round.
The object associated with the command must be a Dictionary(string, Card) of size 4 where each key represents the name of the player which play the card in Value.
Communication direction: Server => Client.
The server uses this command to send the information about the trump to clients.
The object associated to the command must be a CardGameResources.Game.TrumpInfos
Communication direction: Server => Client.
The server use this command to send the updated user CardGameResources.Game.Deck to the client.
The object associated to the command must be a CardGameResources.Game.Deck.
This class have to be used as the System.Object parameter for a Packet with a PacketType of value PacketType.GAME.
Main constructor for Gamecall
Name | Description |
---|---|
action_ |
CardGameResources.Net.GameAction The type of the action you want to send. See also |
-
SysCommand
|
| data_ | System.Object
The object associated to the SysCommand |
Getter and Setter for the action of the Gamecall
Getter and Setter for the data System.Object of the Gamecall
Class used to transfer data across the network.
Default constructor for a Packet
Registration constructor for client side. The key is initialized to 0.
Name | Description |
---|---|
name_ |
System.String The name of the emitter. |
type_ |
CardGameResources.Net.PacketType The type of the System.Object member |
data_ |
System.Object The System.Object which contain the data |
registration_ |
System.Boolean This boolean must be set to tru only if the type is PacketType.SYS and the data's command is of value SysCommand.C_REGISTER |
Main constructor for client side. The key is initialized to 0 and the registration state to false.
Name | Description |
---|---|
name_ |
System.String The name of the emitter. |
type_ |
CardGameResources.Net.PacketType The type of the System.Object member |
data_ |
System.Object The System.Object which contain the data |
Main constructor for server side, the key must be initialized with a value.
Name | Description |
---|---|
name_ |
System.String The name of the emitter. For server side, it will be "root" |
key_ |
System.UInt32 The value of the Locker key |
type_ |
CardGameResources.Net.PacketType The type of the System.Object member |
data_ |
System.Object The System.Object which contain the data |
Getter and Setter for the Packet's data.
Getter and Setter for the Packet's reference on a Locker key
Getter and Setter for the Packet's emitter name.
Getter and Setter for the registration state
Getter and Setter for the Packet's type.
Enum used to defined the type of the Packet's System.Object
The associated object must be an Envcall
The associated object must be an Errcall
The associated object must be a Gamecall
The associated object must be a Syscall
This class have to be used as the System.Object parameter for a Packet with a PacketType of value PacketType.SYS.
Main constructor for Syscall
Name | Description |
---|---|
command_ |
CardGameResources.Net.SysCommand The type of the command you want to send. See also |
-
SysCommand
|
| data_ | System.Object
The object associated to the SysCommand |
Getter and Setter for the command of the Syscall
Getter and Setter for the data System.Object of the Syscall
Enum for the SYS part of the communication protocol.
Communication direction: Client => Server.
Request a registration to the server from a client.
This command must be called only once by game.
The object associated with the command must be null.
Communication direction: Client => Server.
Request a registration to the server from a client.
This command must be called only once by game.
The object associated with the command must be null.
Communication direction: Server => Clien
Inform the client that he has been disconnected from the server.
The object associated with the command must be null.
Communication direction: Client => Server.
Inform the client that a client is about to be ejected from the server.
The object associated with the command must be the name of a client.
Communication direction: Server => Client.
Inform the client that the game has ended.
The object associated with the command must be null.
Communication direction: Client => Server.
Indicate to the server that you have successfully received a message. It also unlocks the next action for the server.
You must send this request less than one second after you received the server message with the same key.
The key of the Packet must match the Locker key you want to unlock.
The object associated with the command must be null.
Communication direction: Server => Client.
Inform the client that the game has begun.
The object associated with the command must be null.