public class CommandData : IAttribute
{
[ProtoMember(1)]
- public RunState State { get; set; }//Run , Stop, SingleSnapshot -> Stop
+ public CommandType State { get; set; }//Run , Stop, SingleSnapshot -> Stop
+
- [ProtoMember(2)]
- private List<DelegateState> DelegatesFlags;
[ProtoMember(3)]
public string Notation { get; set; }
//Choose : Renderer(s)
- public CommandData(RunState assumeState, bool[] theseDelegates)
+ public CommandData(CommandType assumeState)
{
State = assumeState;
- DelegatesFlags = new List<DelegateState>(theseDelegates.Length);
- foreach (var df in theseDelegates)
- {
- DelegatesFlags.Add(new DelegateState()
- {
- Enabled = df,
- AlternateColor = null,
- });
-
- }
-
- }
- public CommandData(RunState assumeState)
- {
- State = assumeState;//Never RUN.
- DelegatesFlags = new List<DelegateState>();
}
{
var temp = ProtoBuf.Serializer.Deserialize<CommandData>(stream.BaseStream);
this.State = temp.State;
- this.DelegatesFlags = temp.DelegatesFlags;
+
}
public string ToJsonToken()
{
- return $"New-State:{State}, Delegates# {DelegatesFlags.Count} ";
+ return $"Command-Type:{State} ";
}
public bool Equals(IWorldAccessor worldForResolve, IAttribute attr)
return false;
}
}
-
- [ProtoContract]
- internal struct DelegateState
- {
- [ProtoMember(1)]
- public bool Enabled;
-
- [ProtoMember(2)]
- public Color? AlternateColor;
-
-
-
- }
}