2 using System.Collections;
3 using System.Collections.Generic;
9 using Vintagestory.API.Common;
10 using Vintagestory.API.Datastructures;
14 [ProtoContract(SkipConstructor = true)]
15 //[ProtoInclude(5,typeof(DelegateState))]
16 public class CommandData : IAttribute
19 public CommandType State { get; set; }//Run , Stop, SingleSnapshot -> Stop
24 public string Notation { get; set; }
26 //POI Delegate list {enabled/Disable}, color?
27 //Other params...? Tick rate?
28 //Choose : Renderer(s)
31 public CommandData(CommandType assumeState)
40 public void FromBytes(BinaryReader stream)
42 var temp = ProtoBuf.Serializer.Deserialize<CommandData>(stream.BaseStream);
43 this.State = temp.State;
48 public void ToBytes(BinaryWriter stream)
50 ProtoBuf.Serializer.Serialize<CommandData>(stream.BaseStream, this);
57 public int GetAttributeId()
62 public object GetValue()
68 public string ToJsonToken()
70 return $"Command-Type:{State} ";
73 public bool Equals(IWorldAccessor worldForResolve, IAttribute attr)
75 var other = attr.GetValue() as CommandData;
77 if (this.State == other.State)
85 public IAttribute Clone( )
87 var cloneCmd = new CommandData(this.State);
88 cloneCmd.Notation = this.Notation;