Пример #1
0
        public override MegaloScriptValueBase Copy(MegaloScriptModel model)
        {
            var result = (MegaloScriptShapeValue)model.CreateValue(ValueType);

            result.ShapeType = ShapeType;

            switch (ShapeType)
            {
            case MegaloScriptShapeType.Sphere:
                result.Radius = Radius;
                break;

            case MegaloScriptShapeType.Cylinder:
                result.Radius = Radius;
                result.Top    = Top;
                result.Bottom = Bottom;
                break;

            case MegaloScriptShapeType.Box:
                result.Radius = Radius;
                result.Length = Length;
                result.Top    = Top;
                result.Bottom = Bottom;
                break;

            case MegaloScriptShapeType.None: break;

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

            return(result);
        }
Пример #2
0
        public override MegaloScriptValueBase Copy(MegaloScriptModel model)
        {
            var result = (MegaloScriptIndexValue)model.CreateValue(ValueType);

            result.Value = Value;

            return(result);
        }
Пример #3
0
        public override MegaloScriptValueBase Copy(MegaloScriptModel model)
        {
            var result = (MegaloScriptVarReferenceValue)model.CreateValue(ValueType);

            CopyVarTo(result);

            return(result);
        }
Пример #4
0
        public override MegaloScriptValueBase Copy(MegaloScriptModel model)
        {
            var result = (MegaloScriptVirtualTriggerValue)model.CreateValue(ValueType);

            result.VirtualTriggerHandle = VirtualTriggerHandle;

            return(result);
        }
Пример #5
0
        public override MegaloScriptValueBase Copy(MegaloScriptModel model)
        {
            var result = (MegaloScriptObjectReferenceWithPlayerVarIndexValue)model.CreateValue(ValueType);

            CopyVarTo(result);
            result.PlayerVarIndex = PlayerVarIndex;

            return(result);
        }
Пример #6
0
        public override MegaloScriptValueBase Copy(MegaloScriptModel model)
        {
            var result = (MegaloScriptNavpointIconParametersValue)model.CreateValue(ValueType);

            result.IconType = IconType;
            result.Numeric  = Numeric;

            return(result);
        }
Пример #7
0
        public override MegaloScriptValueBase Copy(MegaloScriptModel model)
        {
            var result = (MegaloScriptTeamFilterParametersValue)model.CreateValue(ValueType);

            result.FilterType        = FilterType;
            result.Player            = Player;
            result.PlayerAddOrRemove = PlayerAddOrRemove;

            return(result);
        }
Пример #8
0
        public override MegaloScriptValueBase Copy(MegaloScriptModel model)
        {
            var result = (MegaloScriptPoint3dValue)model.CreateValue(ValueType);

            result.X = X;
            result.Y = Y;
            result.Z = Z;

            return(result);
        }
Пример #9
0
        public override MegaloScriptValueBase Copy(MegaloScriptModel model)
        {
            var result = (MegaloScriptWidgetMeterParametersValue)model.CreateValue(ValueType);

            result.Type     = Type;
            result.Timer    = Timer;
            result.Numeric1 = Numeric1;
            result.Numeric2 = Numeric2;

            return(result);
        }
Пример #10
0
        public override MegaloScriptValueBase Copy(MegaloScriptModel model)
        {
            var result = (MegaloScriptTokensValue)model.CreateValue(ValueType);

            result.StringIndex = StringIndex;
            result.TokenCount  = TokenCount;
            if (TokenCount >= 1)
            {
                result.Token0.CopyFrom(Token0);
            }
            if (TokenCount >= 2)
            {
                result.Token1.CopyFrom(Token1);
            }
            if (TokenCount >= 3)
            {
                result.Token2.CopyFrom(Token2);
            }

            return(result);
        }
Пример #11
0
        public void InitializeEmptyValues(MegaloScriptModel model)
        {
            int change_count = 0;

            for (int x = 0; x < mValueIds.Length; x++)
            {
                if (mValueIds[x].IsNotNone())
                {
                    continue;
                }
                change_count++;

                var value = model.CreateValue(ProtoData.ParameterList[x].Type);
                mValueIds[x] = value.Id;
            }

            if (change_count > 0)
            {
                NotifyItemsInitialized();
            }
        }