public override void Serialize(MegaloScriptModel model, IO.BitStream s) { s.Stream(ref mTargetType, 2, MegaloScriptTargetTypeBitStreamer.Instance); switch (TargetType) { case MegaloScriptTargetType.Team: mValue.SerializeTeam(model, s); break; case MegaloScriptTargetType.Player: mValue.SerializePlayer(model, s); break; case MegaloScriptTargetType.None: mValue = MegaloScriptVariableReferenceData.Null; break; } }
public void Serialize(MegaloScriptModel model, IO.BitStream s) { SerializeType(model, s, ref mType); switch (Type) { case MegaloScriptTokenAbstractType.Player: mValue.SerializePlayer(model, s); break; case MegaloScriptTokenAbstractType.Team: mValue.SerializeTeam(model, s); break; case MegaloScriptTokenAbstractType.Object: mValue.SerializeObject(model, s); break; case MegaloScriptTokenAbstractType.Numeric: case MegaloScriptTokenAbstractType.SignedNumeric: mValue.SerializeCustom(model, s); break; case MegaloScriptTokenAbstractType.Timer: mValue.SerializeTimer(model, s); break; default: throw new KSoft.Debug.UnreachableException(Type.ToString()); } }
public override void Serialize(MegaloScriptModel model, IO.BitStream s) { var type = ValueType.VarReference; switch (type) { case MegaloScriptVarReferenceType.Custom: mVar.SerializeCustom(model, s); break; case MegaloScriptVarReferenceType.Player: mVar.SerializePlayer(model, s); break; case MegaloScriptVarReferenceType.Object: mVar.SerializeObject(model, s); break; case MegaloScriptVarReferenceType.Team: mVar.SerializeTeam(model, s); break; case MegaloScriptVarReferenceType.Timer: mVar.SerializeTimer(model, s); break; case MegaloScriptVarReferenceType.Any: mVar.Serialize(model, s); break; default: throw new KSoft.Debug.UnreachableException(type.ToString()); } }