Beispiel #1
0
        static void ProcessMouseMoveEvent(short x, short y, byte button)
        {
            var position = new UnityEngine.Vector2Int(x, y);
            var delta    = position - m_prevMousePos;

            InputSystem.QueueStateEvent(RemoteMouse, new MouseState {
                delta = delta, buttons = button
            });
            m_prevMousePos = position;
        }
Beispiel #2
0
            public void Open(Node parent, Vec2I pos, float g, float h)
            {
                Node node = nodePool[numAllocs];

                open.ResetNode(node);
                ++numAllocs;

                node.Init(parent, pos, g, h);
                open.Enqueue(node, node.f);
                opened[node.pos.x, node.pos.y] = node;
            }
    public void ReplaceDynamicBody(int newLayer, UnityEngine.Vector2Int newVelocity, int newAngularVelocity, bool newIsTrigger)
    {
        var index     = GameComponentsLookup.DynamicBody;
        var component = (DynamicBodyComponent)CreateComponent(index, typeof(DynamicBodyComponent));

        component.Layer           = newLayer;
        component.Velocity        = newVelocity;
        component.AngularVelocity = newAngularVelocity;
        component.IsTrigger       = newIsTrigger;
        ReplaceComponent(index, component);
    }
    public void ReplaceRayCollision(UnityEngine.Vector2Int newSlotPos, System.Nullable <UnityEngine.Vector2> newBoundPos, UnityEngine.Vector2 newCollisionPos, float newAngle)
    {
        var index     = InputComponentsLookup.RayCollision;
        var component = (RayCollisionComponent)CreateComponent(index, typeof(RayCollisionComponent));

        component.SlotPos      = newSlotPos;
        component.BoundPos     = newBoundPos;
        component.CollisionPos = newCollisionPos;
        component.Angle        = newAngle;
        ReplaceComponent(index, component);
    }
Beispiel #5
0
 /// <summary>Write 2D integer vector (8 bytes) to the writer.</summary>
 /// <param name="value">2D ineger vector to write.</param>
 public void Write(UnityEngine.Vector2Int value)
 {
     if (Disposed)
     {
         throw new ObjectDisposedException(GetType().FullName);
     }
     Internal = Allocator.ExpandMessage(Internal, Position, 8);
     Serializer.Write32(Internal, Position, value.x);
     Serializer.Write32(Internal, Position + 4, value.y);
     Position += 8;
 }
Beispiel #6
0
    public InputEntity SetCommand(UnityEngine.Vector2Int newDirection)
    {
        if (hasCommand)
        {
            throw new Entitas.EntitasException("Could not set Command!\n" + this + " already has an entity with CommandComponent!",
                                               "You should check if the context already has a commandEntity before setting it or use context.ReplaceCommand().");
        }
        var entity = CreateEntity();

        entity.AddCommand(newDirection);
        return(entity);
    }
    public GameEntity SetBoardSize(UnityEngine.Vector2Int newValue)
    {
        if (hasBoardSize)
        {
            throw new Entitas.EntitasException("Could not set BoardSize!\n" + this + " already has an entity with BubblePopsC.Scripts.Components.Board.BoardSizeComponent!",
                                               "You should check if the context already has a boardSizeEntity before setting it or use context.ReplaceBoardSize().");
        }
        var entity = CreateEntity();

        entity.AddBoardSize(newValue);
        return(entity);
    }
Beispiel #8
0
    public TimerEntity SetMergeProgress(UnityEngine.Vector2Int newMergeBubblePosition, int newMergeNumber, float newTime)
    {
        if (hasMergeProgress)
        {
            throw new Entitas.EntitasException("Could not set MergeProgress!\n" + this + " already has an entity with MergeProgressComponent!",
                                               "You should check if the context already has a mergeProgressEntity before setting it or use context.ReplaceMergeProgress().");
        }
        var entity = CreateEntity();

        entity.AddMergeProgress(newMergeBubblePosition, newMergeNumber, newTime);
        return(entity);
    }
    public InputEntity SetRayCollision(UnityEngine.Vector2Int newSlotPos, System.Nullable <UnityEngine.Vector2> newBoundPos, UnityEngine.Vector2 newCollisionPos, float newAngle)
    {
        if (hasRayCollision)
        {
            throw new Entitas.EntitasException("Could not set RayCollision!\n" + this + " already has an entity with RayCollisionComponent!",
                                               "You should check if the context already has a rayCollisionEntity before setting it or use context.ReplaceRayCollision().");
        }
        var entity = CreateEntity();

        entity.AddRayCollision(newSlotPos, newBoundPos, newCollisionPos, newAngle);
        return(entity);
    }
    public GameEntity SetBoard(UnityEngine.Vector2Int newValue, bool newIsFirstRowShifted)
    {
        if (hasBoard)
        {
            throw new Entitas.EntitasException("Could not set Board!\n" + this + " already has an entity with BoardComponent!",
                                               "You should check if the context already has a boardEntity before setting it or use context.ReplaceBoard().");
        }
        var entity = CreateEntity();

        entity.AddBoard(newValue, newIsFirstRowShifted);
        return(entity);
    }
    public GameEntity SetWorld(UnityEngine.Vector2Int newSize)
    {
        if (hasWorld)
        {
            throw new Entitas.EntitasException("Could not set World!\n" + this + " already has an entity with GameScene.ECS.Components.WorldComponent!",
                                               "You should check if the context already has a worldEntity before setting it or use context.ReplaceWorld().");
        }
        var entity = CreateEntity();

        entity.AddWorld(newSize);
        return(entity);
    }
Beispiel #12
0
    public void ReplaceCommand(UnityEngine.Vector2Int newDirection)
    {
        var entity = commandEntity;

        if (entity == null)
        {
            entity = SetCommand(newDirection);
        }
        else
        {
            entity.ReplaceCommand(newDirection);
        }
    }
    public void ReplaceWorld(UnityEngine.Vector2Int newSize)
    {
        var entity = worldEntity;

        if (entity == null)
        {
            entity = SetWorld(newSize);
        }
        else
        {
            entity.ReplaceWorld(newSize);
        }
    }
    public void ReplaceRayCollision(UnityEngine.Vector2Int newSlotPos, System.Nullable <UnityEngine.Vector2> newBoundPos, UnityEngine.Vector2 newCollisionPos, float newAngle)
    {
        var entity = rayCollisionEntity;

        if (entity == null)
        {
            entity = SetRayCollision(newSlotPos, newBoundPos, newCollisionPos, newAngle);
        }
        else
        {
            entity.ReplaceRayCollision(newSlotPos, newBoundPos, newCollisionPos, newAngle);
        }
    }
    public void ReplaceBoard(UnityEngine.Vector2Int newValue, bool newIsFirstRowShifted)
    {
        var entity = boardEntity;

        if (entity == null)
        {
            entity = SetBoard(newValue, newIsFirstRowShifted);
        }
        else
        {
            entity.ReplaceBoard(newValue, newIsFirstRowShifted);
        }
    }
    public void ReplaceBoard(UnityEngine.Vector2Int newValue)
    {
        var entity = boardEntity;

        if (entity == null)
        {
            entity = SetBoard(newValue);
        }
        else
        {
            entity.ReplaceBoard(newValue);
        }
    }
Beispiel #17
0
    public void ReplaceMergeProgress(UnityEngine.Vector2Int newMergeBubblePosition, int newMergeNumber, float newTime)
    {
        var entity = mergeProgressEntity;

        if (entity == null)
        {
            entity = SetMergeProgress(newMergeBubblePosition, newMergeNumber, newTime);
        }
        else
        {
            entity.ReplaceMergeProgress(newMergeBubblePosition, newMergeNumber, newTime);
        }
    }
        static private void Serialize_Vector2Int(ref SerializedType ioData, Serializer ioSerializer)
        {
            int x = ioData.x, y = ioData.y;

            ioSerializer.Serialize("x", ref x, FieldOptions.PreferAttribute);
            ioSerializer.Serialize("y", ref y, FieldOptions.PreferAttribute);

            if (ioSerializer.IsReading)
            {
                ioData.x = x;
                ioData.y = y;
            }
        }
        static StackObject *op_Implicit_10(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            UnityEngine.Vector2Int @v = (UnityEngine.Vector2Int) typeof(UnityEngine.Vector2Int).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);


            var result_of_this_method = (UnityEngine.Vector2)v;

            return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method));
        }
        static void WriteBackInstance(ILRuntime.Runtime.Enviorment.AppDomain __domain, StackObject *ptr_of_this_method, IList <object> __mStack, ref UnityEngine.Vector2Int instance_of_this_method)
        {
            ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);
            switch (ptr_of_this_method->ObjectType)
            {
            case ObjectTypes.Object:
            {
                __mStack[ptr_of_this_method->Value] = instance_of_this_method;
            }
            break;

            case ObjectTypes.FieldReference:
            {
                var ___obj = __mStack[ptr_of_this_method->Value];
                if (___obj is ILTypeInstance)
                {
                    ((ILTypeInstance)___obj)[ptr_of_this_method->ValueLow] = instance_of_this_method;
                }
                else
                {
                    var t = __domain.GetType(___obj.GetType()) as CLRType;
                    t.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, instance_of_this_method);
                }
            }
            break;

            case ObjectTypes.StaticFieldReference:
            {
                var t = __domain.GetType(ptr_of_this_method->Value);
                if (t is ILType)
                {
                    ((ILType)t).StaticInstance[ptr_of_this_method->ValueLow] = instance_of_this_method;
                }
                else
                {
                    ((CLRType)t).SetStaticFieldValue(ptr_of_this_method->ValueLow, instance_of_this_method);
                }
            }
            break;

            case ObjectTypes.ArrayReference:
            {
                var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as UnityEngine.Vector2Int[];
                instance_of_arrayReference[ptr_of_this_method->ValueLow] = instance_of_this_method;
            }
            break;
            }
        }
Beispiel #21
0
            public SearchCache(Vec2I size)
            {
                this.size = size;
                int maxNodes = size.x * size.y;

                open   = new FastPriorityQueue <Node>(maxNodes);
                opened = new Node[size.x, size.y];
                closed = new bool[size.x, size.y];

                nodePool  = new List <Node>(maxNodes);
                numAllocs = 0;
                for (int i = 0; i < maxNodes; ++i)
                {
                    nodePool.Add(new Node());
                }
            }
Beispiel #22
0
        static StackObject *ToString_29(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            CSHotFix.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);
            UnityEngine.Vector2Int instance_of_this_method = (UnityEngine.Vector2Int) typeof(UnityEngine.Vector2Int).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));

            var result_of_this_method = instance_of_this_method.ToString();

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            WriteBackInstance(__domain, ptr_of_this_method, __mStack, ref instance_of_this_method);

            __intp.Free(ptr_of_this_method);
            return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method));
        }
        static StackObject *op_Division_5(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Int32 @b = ptr_of_this_method->Value;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            UnityEngine.Vector2Int @a = (UnityEngine.Vector2Int) typeof(UnityEngine.Vector2Int).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);


            var result_of_this_method = a / b;

            return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method));
        }
Beispiel #24
0
        static StackObject *Scale_12(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            CSHotFix.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            UnityEngine.Vector2Int @b = (UnityEngine.Vector2Int) typeof(UnityEngine.Vector2Int).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            UnityEngine.Vector2Int @a = (UnityEngine.Vector2Int) typeof(UnityEngine.Vector2Int).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);


            var result_of_this_method = UnityEngine.Vector2Int.Scale(@a, @b);

            return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method));
        }
        static StackObject *get_y_0(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);
            UnityEngine.Vector2Int instance_of_this_method = (UnityEngine.Vector2Int) typeof(UnityEngine.Vector2Int).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags) 16);

            var result_of_this_method = instance_of_this_method.y;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            WriteBackInstance(__domain, ptr_of_this_method, __mStack, ref instance_of_this_method);

            __intp.Free(ptr_of_this_method);
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value      = result_of_this_method;
            return(__ret + 1);
        }
        static StackObject *get_magnitude_11(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);
            UnityEngine.Vector2Int instance_of_this_method = (UnityEngine.Vector2Int) typeof(UnityEngine.Vector2Int).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));

            var result_of_this_method = instance_of_this_method.magnitude;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            WriteBackInstance(__domain, ptr_of_this_method, __mStack, ref instance_of_this_method);

            __intp.Free(ptr_of_this_method);
            __ret->ObjectType       = ObjectTypes.Float;
            *(float *)&__ret->Value = result_of_this_method;
            return(__ret + 1);
        }
        static int _m_RoundToInt_xlua_st_(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);



                {
                    UnityEngine.Vector2 _v; translator.Get(L, 1, out _v);

                    UnityEngine.Vector2Int gen_ret = UnityEngine.Vector2Int.RoundToInt(_v);
                    translator.Push(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
Beispiel #28
0
        static StackObject *Distance_9(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            CSHotFix.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            UnityEngine.Vector2Int @b = (UnityEngine.Vector2Int) typeof(UnityEngine.Vector2Int).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            UnityEngine.Vector2Int @a = (UnityEngine.Vector2Int) typeof(UnityEngine.Vector2Int).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);


            var result_of_this_method = UnityEngine.Vector2Int.Distance(@a, @b);

            __ret->ObjectType       = ObjectTypes.Float;
            *(float *)&__ret->Value = result_of_this_method;
            return(__ret + 1);
        }
Beispiel #29
0
        static StackObject *set_size_24(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            CSHotFix.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            UnityEngine.Vector2Int @value = (UnityEngine.Vector2Int) typeof(UnityEngine.Vector2Int).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);
            UnityEngine.RectInt instance_of_this_method;
            instance_of_this_method = (UnityEngine.RectInt) typeof(UnityEngine.RectInt).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));

            instance_of_this_method.size = value;

            WriteBackInstance(__domain, ptr_of_this_method, __mStack, ref instance_of_this_method);

            return(__ret);
        }
        static StackObject *op_Inequality_8(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            UnityEngine.Vector2Int @rhs = (UnityEngine.Vector2Int) typeof(UnityEngine.Vector2Int).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            UnityEngine.Vector2Int @lhs = (UnityEngine.Vector2Int) typeof(UnityEngine.Vector2Int).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);


            var result_of_this_method = lhs != rhs;

            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value      = result_of_this_method ? 1 : 0;
            return(__ret + 1);
        }