Record Class GameConfig
java.lang.Object
java.lang.Record
dev.zwazel.internal.message.data.GameConfig
- Record Components:
 tickRate- the tick rateclientId- my client IDmapDefinition- the map definition, including the map configuration with all markers, like spawn points, flags, etc.connectedClients- the connected clients, including their client ID, name, team, and TankTypeteamConfigs- the team configurations, including the team name and amount of players maxtankConfigs- the tank configurations, including the tank type, speed, health, etc.
- All Implemented Interfaces:
 MessageData
public record GameConfig(long tickRate, long clientId, MapDefinition mapDefinition, ConnectedClientConfig[] connectedClients, HashMap<String,TeamConfig> teamConfigs, HashMap<TankType,TankConfig> tankConfigs)
extends Record
implements MessageData  
Represents the configuration of the game.
 Received when the game starts.
 Contains information about the game, the map, the clients, the teams, and the tanks.
- 
Constructor Summary
ConstructorsConstructorDescriptionGameConfig(long tickRate, long clientId, MapDefinition mapDefinition, ConnectedClientConfig[] connectedClients, HashMap<String, TeamConfig> teamConfigs, HashMap<TankType, TankConfig> tankConfigs) Creates an instance of aGameConfigrecord class. - 
Method Summary
Modifier and TypeMethodDescriptionbooleanapplyOnReceive(InternalGameWorld internalWorld) Applies to the world when receivedlongclientId()Returns the value of theclientIdrecord component.Returns the value of theconnectedClientsrecord component.final booleanIndicates whether some other object is "equal to" this one.getClientConfig(long clientId) getClientConfig(String clientName) getTankConfig(TankType tankType) getTeamConfig(String teamName) getTeamMembers(String teamName) Gets team members.getTeamMembers(String teamName, Long excludeClientId) Gets team members.final inthashCode()Returns a hash code value for this object.Returns the value of themapDefinitionrecord component.Returns the value of thetankConfigsrecord component.Returns the value of theteamConfigsrecord component.longtickRate()Returns the value of thetickRaterecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface dev.zwazel.internal.message.MessageData
applyBeforeSend, applyOnAddingToQueue, isUnique 
- 
Constructor Details
- 
GameConfig
public GameConfig(long tickRate, long clientId, MapDefinition mapDefinition, ConnectedClientConfig[] connectedClients, HashMap<String, TeamConfig> teamConfigs, HashMap<TankType, TankConfig> tankConfigs) Creates an instance of aGameConfigrecord class.- Parameters:
 tickRate- the value for thetickRaterecord componentclientId- the value for theclientIdrecord componentmapDefinition- the value for themapDefinitionrecord componentconnectedClients- the value for theconnectedClientsrecord componentteamConfigs- the value for theteamConfigsrecord componenttankConfigs- the value for thetankConfigsrecord component
 
 - 
 - 
Method Details
- 
applyOnReceive
Description copied from interface:MessageDataApplies to the world when received- Specified by:
 applyOnReceivein interfaceMessageData- Parameters:
 internalWorld- the world- Returns:
 - if true, we add it to the Input Queue, so Bots can read them. If false, we don't.
 
 - 
getMyConfig
 - 
getClientConfig
 - 
getClientConfig
 - 
getTeamConfig
 - 
getMyTeamConfig
 - 
getTeamMembers
Gets team members. Can include the client itself, if it is part of the team.- Parameters:
 teamName- the team name- Returns:
 - the team members
 
 - 
getTeamMembers
Gets team members. Can exclude a specific client from the list.- Parameters:
 teamName- the team nameexcludeClientId- the exclude client id- Returns:
 - the team members
 
 - 
getTankConfig
 - 
toString
 - 
hashCode
 - 
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. - 
tickRate
 - 
clientId
 - 
mapDefinition
Returns the value of themapDefinitionrecord component.- Returns:
 - the value of the 
mapDefinitionrecord component 
 - 
connectedClients
Returns the value of theconnectedClientsrecord component.- Returns:
 - the value of the 
connectedClientsrecord component 
 - 
teamConfigs
Returns the value of theteamConfigsrecord component.- Returns:
 - the value of the 
teamConfigsrecord component 
 - 
tankConfigs
Returns the value of thetankConfigsrecord component.- Returns:
 - the value of the 
tankConfigsrecord component 
 
 -