Esempio n. 1
0
        public override void Serialize(MegaloScriptModel model, IO.BitStream s)
        {
            s.Stream(ref mType, 2, MegaloScriptWidgetMeterTypeBitStreamer.Instance);

            if (Type == MegaloScriptWidgetMeterType.Numeric)
            {
                mNumeric1.SerializeCustom(model, s);
                mNumeric2.SerializeCustom(model, s);
            }
            else if (Type == MegaloScriptWidgetMeterType.Timer)
            {
                mTimer.SerializeTimer(model, s);
            }
        }
Esempio n. 2
0
        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());
            }
        }
Esempio n. 3
0
        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());
            }
        }