Esempio n. 1
0
    /// <summary>
    /// Makes the ship that is currently under the cursor to be the current selected ship
    /// </summary>
    public void shipSelectUpdate()
    {
        Ship hover = null;

        foreach (Ship s in gameManager.getPlayerShips())
        {
            if (Vector2.Distance(s.transform.position, mouseWorldPos()) < shipSelectRadius)
            {
                hover = s;
                break;
            }
        }

        if (Input.GetMouseButtonDown(0))
        {
            if (EventSystem.current.IsPointerOverGameObject())
            {
                return;
            }

            uiControl.Selected = hover;
            if (hover != null)
            {
                DebugControl.log("select", "selected ship " + hover.team.ToString() + " " + hover.Id);
            }
        }
    }
Esempio n. 2
0
        private SDLastEvent GetLastEventInformation()
        {
            try {
                uint     extraInformationSize = 500;
                var      buffer      = new byte[extraInformationSize];
                GCHandle pinnedArray = GCHandle.Alloc(buffer, GCHandleType.Pinned);
                try {
                    DEBUG_EVENT type;
                    uint        processId;
                    uint        threadId;
                    IntPtr      extraInformation = pinnedArray.AddrOfPinnedObject();
                    uint        extraInformationUsed;
                    int         descriptionSize = 500;
                    var         description     = new StringBuilder(descriptionSize);
                    uint        descriptionUsed;
                    Utility.CheckHRESULT(DebugControl.GetLastEventInformation(
                                             out type, out processId, out threadId, extraInformation, extraInformationSize,
                                             out extraInformationUsed, description, descriptionSize, out descriptionUsed));

                    return(new SDLastEvent()
                    {
                        Type = type.ToString(),
                        Description = description.ToString(),
                        ThreadId = threadId
                    });
                } finally {
                    pinnedArray.Free();
                }
            } catch (Exception) {
                return(null);
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Execute a debugger command.
        /// </summary>
        public string Execute(string command)
        {
            StringBuilder outputText = _OutputCallbacks.OutputText;
            DEBUG_OUTPUT  mask       = _OutputCallbacks.OutputMask;

            outputText.Clear();
            _OutputCallbacks.OutputMask = DEBUG_OUTPUT.NORMAL | DEBUG_OUTPUT.SYMBOLS | DEBUG_OUTPUT.ERROR | DEBUG_OUTPUT.WARNING;

            _Log.WriteLine("Executing Debugger Command: " + command);

            string result = null;

            try
            {
                int hr = DebugControl.Execute(DEBUG_OUTCTL.ALL_CLIENTS, command, DEBUG_EXECUTE.DEFAULT);
                if (hr < 0)
                {
                    outputText.Append(string.Format("Command encountered an error.  HRESULT={0:X8}", hr));
                }

                result = _OutputCallbacks.OutputText.ToString();
            }
            finally
            {
                _OutputCallbacks.OutputMask = mask;
                outputText.Clear();
            }

            _Log.WriteLine("Debugger Command Result:");
            _Log.WriteLine(result);

            return(result);
        }
Esempio n. 4
0
		public BasicBreakpoint( DebugControl control, BreakpointType type, int address )
			: base( type, address )
		{
			Debug.Assert( control != null );
			if( control == null )
				throw new ArgumentNullException( "control" );
			_control = control;
		}
Esempio n. 5
0
        /// <summary>
        /// Evaluate the input expression into a memory address.
        /// </summary>
        private bool EvaluateExpression(string expression, out ulong result)
        {
            result = 0;
            DEBUG_VALUE debugValue;
            uint        remainderIndex;
            int         hr = DebugControl.Evaluate(expression, IntPtr.Size == 4 ? DEBUG_VALUE_TYPE.INT32 : DEBUG_VALUE_TYPE.INT64, out debugValue, out remainderIndex);

            if (hr == 0)
            {
                result = IntPtr.Size == 4 ? debugValue.I32 : debugValue.I64;
            }

            return(hr == 0);
        }
Esempio n. 6
0
    void Awake()
    {
        _instance = this;

        // add all enemies to manager
        if (transform.childCount > 0)
        {
            foreach (Transform child in this.transform)
            {
                EnemiesList.Add(child.GetComponent <EnemyAI>());
            }

            alarmedValue = EnemiesList[0].GetComponent <EnemyAlert>().ALARMED_VALUE;
        }

        player = GameObject.FindGameObjectWithTag("Player");

        debugcontrol = DebugControl.Instance;
    }
Esempio n. 7
0
        public GameScreen(ScreenComponent manager) : base(manager)
        {
            Manager = manager;
            Padding = Border.All(0);

            SceneControl scene = new SceneControl(manager);

            scene.HorizontalAlignment = HorizontalAlignment.Stretch;
            scene.VerticalAlignment   = VerticalAlignment.Stretch;
            Controls.Add(scene);

            DebugControl debug = new DebugControl(manager);

            debug.HorizontalAlignment = HorizontalAlignment.Stretch;
            debug.VerticalAlignment   = VerticalAlignment.Stretch;
            Controls.Add(debug);

            CompassControl compass = new CompassControl(manager);

            compass.HorizontalAlignment = HorizontalAlignment.Center;
            compass.VerticalAlignment   = VerticalAlignment.Top;
            compass.Width  = 300;
            compass.Height = 30;
            Controls.Add(compass);

            ToolbarControl toolbar = new ToolbarControl(manager);

            toolbar.HorizontalAlignment = HorizontalAlignment.Stretch;
            toolbar.VerticalAlignment   = VerticalAlignment.Bottom;
            toolbar.Height = 100;
            Controls.Add(toolbar);

            MinimapControl minimap = new MinimapControl(manager, scene);

            minimap.HorizontalAlignment = HorizontalAlignment.Right;
            minimap.VerticalAlignment   = VerticalAlignment.Bottom;
            minimap.Width  = 128;
            minimap.Height = 128;
            minimap.Margin = Border.All(5);
            Controls.Add(minimap);
        }
Esempio n. 8
0
    /// <summary>
    /// Moves in the given direction (should be forwards or backwards)
    /// </summary>
    /// <param name="direction">the direction to move</param>
    public void move(int direction)                             //throws ShipCrashedException
    {
        DebugControl.log("action", "----moving ship");
        Node destNode = Node.getAdjacentNode(direction);

        if (destNode == null)
        {
            //life--;
            TakeDamage(1);
            canAct = false;
            canActAfterCollision = false;
            //Debug.Log("----Ship crashed");
            NeedRedirect = true;
            movedForward = false;
            momentum     = 0;
            if (PhotonNetwork.IsConnected)
            {
                PhotonView.Get(this).RPC("activateRedirectNotification", RpcTarget.All);
            }
            if (team == GameManager.playerTeam)
            {
                activateRedirectNotification();
            }
            return;
        }


        Node startNode = Node;

        Node.Ships.Remove(this);
        Node = destNode;
        Node.Ships.Add(this);
        bool reverse = direction == getRelativeDirection(-4);

        PhaseManager.actionAnimations.Add(this, new MovementAnimation(startNode, destNode, this, momentum, reverse));
    }