public override void ToTreeAttributes(ITreeAttribute tree) { base.ToTreeAttributes(tree); ITreeAttribute invtree = new TreeAttribute(); Inventory.ToTreeAttributes(invtree); tree["inventory"] = invtree; tree.SetFloat("inputGrindTime", inputGrindTime); tree.SetInt("nowOutputFace", nowOutputFace); List <int> vals = new List <int>(); foreach (var val in playersGrinding) { IPlayer plr = Api.World.PlayerByUid(val.Key); if (plr == null) { continue; } vals.Add(plr.ClientId); } tree["clientIdsGrinding"] = new IntArrayAttribute(vals.ToArray()); }
/*public override void SetName(string playername) * { * base.SetName(playername); * this.Name = playername; * }*/ public override void ToBytes(BinaryWriter writer, bool forClient) { TreeAttribute tree; WatchedAttributes["gearInv"] = tree = new TreeAttribute(); inv.ToTreeAttributes(tree); base.ToBytes(writer, forClient); }
public override void ToTreeAttributes(ITreeAttribute tree) { base.ToTreeAttributes(tree); ITreeAttribute invtree = new TreeAttribute(); Inventory.ToTreeAttributes(invtree); tree["inventory"] = invtree; tree.SetFloat("inputGrindTime", inputGrindTime); tree["clientIdsGrinding"] = new IntArrayAttribute(playersGrinding.Select(p => p.ClientId).ToArray()); }