Beispiel #1
0
        protected override bool ValueEquals(MegaloScriptValueBase other)
        {
            var obj = (MegaloScriptTeamFilterParametersValue)other;

            return(FilterType == obj.FilterType &&
                   Player.Equals(obj.Player) && PlayerAddOrRemove.Equals(obj.PlayerAddOrRemove));
        }
Beispiel #2
0
        void Write <TDoc, TCursor>(MegaloScriptModel model, IO.TagElementStream <TDoc, TCursor, string> s,
                                   bool embedValues)
            where TDoc : class
            where TCursor : class
        {
            bool multiple_params  = mValueIds.Length > 1;
            bool write_extra_info = s.IsWriting && model.TagElementStreamSerializeFlags.HasParamFlags();

            for (int x = 0; x < mValueIds.Length; x++)
            {
                using (s.EnterCursorBookmark("Param"))
                {
                    if (write_extra_info)
                    {
                        ProtoData.ParameterList[x].WriteExtraModelInfo(model.Database, s, multiple_params, model.TagElementStreamSerializeFlags);
                    }

                    Contract.Assert(mValueIds[x].IsNotNone());
                    if (embedValues)
                    {
                        MegaloScriptValueBase.SerializeValueForEmbed(model, s, ref mValueIds[x]);
                    }
                    else
                    {
                        s.StreamCursor(ref mValueIds[x]);
                    }
                }
            }
        }
Beispiel #3
0
        void Read <TDoc, TCursor>(MegaloScriptModel model, IO.TagElementStream <TDoc, TCursor, string> s,
                                  bool embedValues)
            where TDoc : class
            where TCursor : class
        {
            int param_index = 0;

            foreach (var node in s.ElementsByName("Param"))
            {
                using (s.EnterCursorBookmark(node))
                {
                    if (embedValues)
                    {
                        MegaloScriptValueBase.SerializeValueForEmbed(model, s, ref mValueIds[param_index]);
                    }
                    else
                    {
                        s.StreamCursor(ref mValueIds[param_index]);
                    }

                    Contract.Assert(mValueIds[param_index].IsNotNone());
                    param_index++;

                    if (param_index == mValueIds.Length)
                    {
                        break;
                    }
                }
            }
        }
Beispiel #4
0
        protected override bool ValueEquals(MegaloScriptValueBase other)
        {
            var obj = (MegaloScriptShapeValue)other;

            bool equals = ShapeType == obj.ShapeType;

            switch (ShapeType)
            {
            case MegaloScriptShapeType.Sphere:
                equals &= Radius.Equals(obj.Radius);
                break;

            case MegaloScriptShapeType.Cylinder:
                equals &= Radius.Equals(obj.Radius) &&
                          Top.Equals(obj.Top) && Bottom.Equals(obj.Bottom);
                break;

            case MegaloScriptShapeType.Box:
                equals &= Radius.Equals(obj.Radius) &&
                          Length.Equals(obj.Length) &&
                          Top.Equals(obj.Top) && Bottom.Equals(obj.Bottom);
                break;

            case MegaloScriptShapeType.None: break;

            default: throw new KSoft.Debug.UnreachableException(ShapeType.ToString());
            }

            return(equals);
        }
Beispiel #5
0
        protected override bool ValueEquals(MegaloScriptValueBase other)
        {
            var obj = (MegaloScriptWidgetMeterParametersValue)other;

            bool result = Type == obj.Type;

            if (result)
            {
                if (Type == MegaloScriptWidgetMeterType.Numeric)
                {
                    result &= Numeric1.Equals(obj.Numeric1) && Numeric2.Equals(obj.Numeric2);
                }
                else if (Type == MegaloScriptWidgetMeterType.Timer)
                {
                    result &= Timer.Equals(obj.Timer);
                }
            }

            return(result);
        }
Beispiel #6
0
        protected override bool ValueEquals(MegaloScriptValueBase other)
        {
            var obj = (MegaloScriptTokensValue)other;

            bool equals = StringIndex == obj.StringIndex && TokenCount == obj.TokenCount;

            if (TokenCount >= 1)
            {
                equals &= Token0.Equals(obj.Token0);
            }
            if (TokenCount >= 2)
            {
                equals &= Token0.Equals(obj.Token1);
            }
            if (TokenCount >= 2)
            {
                equals &= Token0.Equals(obj.Token2);
            }

            return(equals);
        }
Beispiel #7
0
        protected override bool ValueEquals(MegaloScriptValueBase other)
        {
            var obj = (MegaloScriptIndexValue)other;

            return(Value == obj.Value);
        }
Beispiel #8
0
        protected override bool ValueEquals(MegaloScriptValueBase other)
        {
            var obj = (MegaloScriptVarReferenceValueBase)other;

            return(Var.Equals(obj.Var));
        }
Beispiel #9
0
 protected override bool ValueEquals(MegaloScriptValueBase other)
 {
     return(base.ValueEquals(other) &&
            PlayerVarIndex == ((MegaloScriptObjectReferenceWithPlayerVarIndexValue)other).PlayerVarIndex);
 }
Beispiel #10
0
        protected override bool ValueEquals(MegaloScriptValueBase other)
        {
            var obj = (MegaloScriptVirtualTriggerValue)other;

            return(VirtualTriggerHandle.Equals(obj.VirtualTriggerHandle));
        }
Beispiel #11
0
        protected override bool ValueEquals(MegaloScriptValueBase other)
        {
            var obj = (MegaloScriptPoint3dValue)other;

            return(X == obj.X && Y == obj.Y && Z == obj.Z);
        }
        protected override bool ValueEquals(MegaloScriptValueBase other)
        {
            var obj = (MegaloScriptNavpointIconParametersValue)other;

            return(mIconType == obj.mIconType && mNumeric.Equals(obj.mNumeric));
        }
Beispiel #13
0
        protected override bool ValueEquals(MegaloScriptValueBase other)
        {
            var obj = (MegaloScriptTargetVarValue)other;

            return(TargetType == obj.TargetType && Value.Equals(obj.Value));
        }