Beispiel #1
0
 public REPlayer(int uniqueID, string account, string inventoryDataString, string appliancesDataString, int money, REPeer peer)
     : base(uniqueID, account, money)
 {
     this.peer = peer;
     inventory = JsonConvert.DeserializeObject<Inventory>(inventoryDataString, new JsonSerializerSettings { TypeNameHandling = TypeNameHandling.Auto });
     appliances = JsonConvert.DeserializeObject<Dictionary<ApplianceID, Appliance>>(appliancesDataString, new JsonSerializerSettings { TypeNameHandling = TypeNameHandling.Auto });
 }
Beispiel #2
0
 public void Broadcast(REPeer[] peers, BroadcastType broadcastType, Dictionary<byte, object> parameter)
 {
     EventData eventData = new EventData((byte)broadcastType, parameter);
     foreach (REPeer peer in peers)
     {
         peer.SendEvent(eventData, new SendParameters());
     }
 }
Beispiel #3
0
 public REPlayer(int uniqueID, string account, REPeer peer)
     : base(uniqueID, account, 100)
 {
     this.peer = peer;
     inventory = new Inventory()
     {
         new Log(150),
         new IronOre(20),
         new Rock(30),
         new Hemp(40),
         new Oak(20),
         new Cypress(20),
         new Clay(50),
         new CopperOre(20),
         new Coal(100),
         new Water(100),
         new Cotton(100)
     };
     appliances = new Dictionary<ApplianceID, Appliance>() { { ApplianceID.Machete, new Machete() } };
 }