Пример #1
0
        public override void Serialize(MegaloScriptModel model, IO.BitStream s)
        {
            s.Stream(ref mShapeType, 2, MegaloScriptShapeTypeBitStreamer.Instance);

            switch (ShapeType)
            {
            case MegaloScriptShapeType.Sphere:
                mRadius.SerializeCustom(model, s);
                break;

            case MegaloScriptShapeType.Cylinder:
                mRadius.SerializeCustom(model, s);
                mTop.SerializeCustom(model, s);
                mBottom.SerializeCustom(model, s);
                break;

            case MegaloScriptShapeType.Box:
                mRadius.SerializeCustom(model, s);
                mLength.SerializeCustom(model, s);
                mTop.SerializeCustom(model, s);
                mBottom.SerializeCustom(model, s);
                break;

            case MegaloScriptShapeType.None: break;

            default: throw new KSoft.Debug.UnreachableException(ShapeType.ToString());
            }
        }
Пример #2
0
 public override void Serialize(MegaloScriptModel model, IO.BitStream s)
 {
     s.Stream(ref mIconType, 5, NavpointIconTypeBitStreamer.Instance);
     if (mIconType == MegaloScriptNavpointIconType.Territory)
     {
         mNumeric.SerializeCustom(model, s);
     }
 }
Пример #3
0
        public override void Serialize(MegaloScriptModel model, IO.BitStream s)
        {
            s.Stream(ref mFilterType, 3, MegaloScriptPlayerFilterTypeBitStreamer.Instance);

            if (FilterType == MegaloScriptPlayerFilterType.PlayerMask)
            {
                mPlayer.SerializePlayer(model, s);
                mPlayerAddOrRemove.SerializeCustom(model, s);
            }
        }
Пример #4
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);
            }
        }
Пример #5
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());
            }
        }
Пример #6
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());
            }
        }