public CultureVoteServer( NetworkCommunicator peer, CultureVoteTypes type, BasicCultureObject culture) { this.Peer = peer; this.VotedType = type; this.VotedCulture = culture; }
protected override bool OnRead() { bool bufferReadValid = true; this.VotedType = (CultureVoteTypes)GameNetworkMessage.ReadIntFromPacket(CompressionMission.TeamSideCompressionInfo, ref bufferReadValid); int index = GameNetworkMessage.ReadIntFromPacket(CompressionBasic.CultureIndexCompressionInfo, ref bufferReadValid); if (bufferReadValid) { this.VotedCulture = MBObjectManager.Instance.GetObjectTypeList <BasicCultureObject>()[index]; } return(bufferReadValid); }
protected override bool OnRead() { bool bufferReadValid = true; this.Peer = GameNetworkMessage.ReadNetworkPeerReferenceFromPacket(ref bufferReadValid); this.VotedType = (CultureVoteTypes)GameNetworkMessage.ReadIntFromPacket(CompressionMission.TeamSideCompressionInfo, ref bufferReadValid); int index = GameNetworkMessage.ReadIntFromPacket(CompressionBasic.CultureIndexCompressionInfo, ref bufferReadValid); if (bufferReadValid) { MBReadOnlyList <BasicCultureObject> objectTypeList = MBObjectManager.Instance.GetObjectTypeList <BasicCultureObject>(); this.VotedCulture = index < 0 ? (BasicCultureObject)null : objectTypeList[index]; } return(bufferReadValid); }
public CultureVoteClient(CultureVoteTypes type, BasicCultureObject culture) { this.VotedType = type; this.VotedCulture = culture; }