Last active
June 30, 2016 11:40
-
-
Save glitchersgames/f9dfd36fa427de7b079371629b04d528 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PlayerRequestPlayerDataMessage : MessageBase | |
{ | |
public NetworkInstanceId m_SenderNetId; | |
public NetworkInstanceId m_SubjectNetId; | |
public PlayerRequestPlayerDataMessage(){} | |
public PlayerRequestPlayerDataMessage( NetworkInstanceId senderNetId, NetworkInstanceId subjectNetId ) | |
{ | |
m_SenderNetId = senderNetId; | |
m_SubjectNetId = subjectNetId; | |
} | |
} | |
public class PlayerDefMessage : MessageBase | |
{ | |
public NetworkInstanceId m_PlayerNetId; | |
public string m_PlayerName; | |
public Color m_PlayerColor; | |
public PlayerDefMessage(){} | |
public PlayerDefMessage( NetworkInstanceId playerNetId, PlayerDef playerDef ) | |
{ | |
m_PlayerNetId = playerNetId; | |
m_PlayerName = playerDef.m_Name; | |
m_PlayerColor = playerDef.m_Color; | |
} | |
// this is a small helper function to create PlayerDef directly from a message | |
public PlayerDef CreatePlayerDef() | |
{ | |
return new PlayerDef( m_PlayerName, m_PlayerColor ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment