void HandleInpput()
    {
        if (Input.GetKeyDown(KeyCode.Q))
        {
            KeyQ.Execute(anim, true);
            oldCommands.Add(KeyQ);
        }
        else if (Input.GetKeyDown(KeyCode.W))
        {
            KeyW.Execute(anim, true);
            oldCommands.Add(KeyW);
        }
        else if (Input.GetKeyDown(KeyCode.E))
        {
            KeyE.Execute(anim, true);
            oldCommands.Add(KeyE);
        }
        else if (Input.GetKeyDown(KeyCode.UpArrow))
        {
            upArrow.Execute(anim, true);
            oldCommands.Add(upArrow);
        }

        if (Input.GetKeyDown(KeyCode.Space))
        {
            shouldStartReply = true;
        }

        if (Input.GetKeyDown(KeyCode.Z))
        {
            UndoLastCommand();
        }
    }
Ejemplo n.º 2
0
        private static void SendToStatusBar(KeyE keyE, string info)
        {
            if (eventAggregator == null)
            {
                eventAggregator = ServiceLocator.Current.GetInstance <IEventAggregator>();
            }

            eventAggregator.GetEvent <StatusInfoEvent>().Publish(new Tuple <KeyE, string>(keyE, info));
        }
Ejemplo n.º 3
0
        public void SubmitOrderSuccess(string exchangeName, string orderId, string info, [CallerMemberName] string memberName = "", [CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = -1)
        {
            KeyE keyE = new KeyE(3, 6);

            SendToStatusBar(keyE, string.Format("", exchangeName, orderId, info));
            if (this.IsEnabled())
            {
                this.WriteEvent(1101, exchangeName, orderId, info, memberName, sourceFilePath, sourceLineNumber);
            }
        }
Ejemplo n.º 4
0
        public void QueryDataException(string dataType, string exchangeName, string exceptionMessage, [CallerMemberName] string memberName = "", [CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = -1)
        {
            KeyE keyE = new KeyE(3, 5);

            SendToStatusBar(keyE, string.Format("", dataType, exchangeName, exceptionMessage));
            if (this.IsEnabled())
            {
                this.WriteEvent(1002, dataType, exchangeName, exceptionMessage, memberName, sourceFilePath, sourceLineNumber);
            }
        }
Ejemplo n.º 5
0
        public void QueryDataSuccess(string dataType, string exchangeName, [CallerMemberName] string memberName = "", [CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = -1)
        {
            KeyE keyE = new KeyE(3, 6);

            SendToStatusBar(keyE, string.Format(Resources.QueryDataSuccess, dataType, exchangeName));
            if (this.IsEnabled())
            {
                this.WriteEvent(1001, dataType, exchangeName, memberName, sourceFilePath, sourceLineNumber);
            }
        }
Ejemplo n.º 6
0
        public void CancelOrderFail(string exchangeName, string orderId, string info, [CallerMemberName] string memberName = "", [CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = -1)
        {
            KeyE keyE = new KeyE(3, 2);

            SendToStatusBar(keyE, string.Format(Resources.CancelOrderFail, exchangeName, orderId, info));
            if (this.IsEnabled())
            {
                this.WriteEvent(1202, exchangeName, orderId, memberName, sourceFilePath, sourceLineNumber);
            }
        }
Ejemplo n.º 7
0
        public void BeginDownloadDataAsync(string dataType, string exchangeName, string pairCode, [CallerMemberName] string memberName = "", [CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = -1)
        {
            KeyE   keyE = new KeyE(3, 0);
            string info = string.Format(Resources.BeginDownladDataAsync, dataType, exchangeName, pairCode);

            if (this.IsEnabled())
            {
                this.WriteEvent(501, dataType, exchangeName, pairCode, memberName, sourceFilePath, sourceLineNumber);
            }
        }
Ejemplo n.º 8
0
        public void UpdateRateException(string apiName, string pairCode, string exceptionMessage, [CallerMemberName] string memberName = "", [CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = -1)
        {
            KeyE keyE = new KeyE(3, 3); //巽色

            SendToStatusBar(keyE, string.Format("", apiName, pairCode, exceptionMessage));
            if (this.IsEnabled())
            {
                this.WriteEvent(404, apiName, pairCode, exceptionMessage, memberName, sourceFilePath, sourceLineNumber);
            }
        }
Ejemplo n.º 9
0
        public void UpdateRateSuccess(string apiName, string pairCode, string rate, [CallerMemberName] string memberName = "", [CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = -1)
        {
            KeyE keyE = new KeyE(3, 2); //坎色

            SendToStatusBar(keyE, string.Format(Resources.RateInfoQuerySuccess, apiName, pairCode, rate));
            if (this.IsEnabled())
            {
                this.WriteEvent(403, apiName, pairCode, rate, memberName, sourceFilePath, sourceLineNumber);
            }
        }
Ejemplo n.º 10
0
        public void DownloadRateAsnycError(string apiName, string pairCode, string errorMessage, [CallerMemberName] string memberName = "", [CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = -1)
        {
            KeyE keyE = new KeyE(3, 1); //艮色

            SendToStatusBar(keyE, string.Format(Resources.RateInfoQueryFail, apiName, pairCode, errorMessage));
            if (this.IsEnabled())
            {
                this.WriteEvent(402, apiName, pairCode, errorMessage, memberName, sourceFilePath, sourceLineNumber);
            }
        }
Ejemplo n.º 11
0
        public void BeginDownloadRate(string apiName, string pairCode, [CallerMemberName] string memberName = "", [CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = -1)
        {
            KeyE keyE = new KeyE(3, 0);//坤色

            SendToStatusBar(keyE, string.Format(Resources.RateInfoBeginQuery, apiName, pairCode));
            if (this.IsEnabled())
            {
                this.WriteEvent(401, apiName, pairCode, memberName, sourceFilePath, sourceLineNumber);
            }
        }
Ejemplo n.º 12
0
        public void SubmitOrderException(string exchangeName, string info, [CallerMemberName] string memberName = "", [CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = -1)
        {
            KeyE keyE = new KeyE(3, 7);

            SendToStatusBar(keyE, string.Format(Resources.SubmitOrderException, exchangeName, info));
            if (this.IsEnabled())
            {
                this.WriteEvent(1103, exchangeName, info, memberName, sourceFilePath, sourceLineNumber);
            }
        }
Ejemplo n.º 13
0
        public void UpdateDataException(string dataType, string exchangeName, string pairCode, string exceptionMessage, [CallerMemberName] string memberName = "", [CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = -1)
        {
            KeyE   keyE = new KeyE(3, 3);
            string info = string.Format(Resources.UpdateDataException, dataType, exchangeName, pairCode, exceptionMessage);

            SendToStatusBar(keyE, info);
            if (this.IsEnabled())
            {
                this.WriteEvent(504, dataType, exchangeName, pairCode, exceptionMessage, memberName, sourceFilePath, sourceLineNumber);
            }
        }
Ejemplo n.º 14
0
        public void ApiKeyNotExist(string exchangeName, string functionInfo, [CallerMemberName] string memberName = "", [CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = -1)
        {
            KeyE keyE = new KeyE(2, 2);//黄

            SendToStatusBar(keyE, string.Format(Resources.NoApiKeyCantWork, exchangeName, functionInfo));

            if (this.IsEnabled())
            {
                this.WriteEvent(304, exchangeName, functionInfo, memberName, sourceFilePath, sourceLineNumber);
            }
        }
Ejemplo n.º 15
0
        public void NoPairSelected(string exchangeName, string functionInfo, [CallerMemberName] string memberName = "", [CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = -1)
        {
            KeyE   keyE = new KeyE(2, 2); //黄
            string info = string.Format(Resources.ConfigOption + ":" + Resources.YourNeverSelectAnyPairInExchage, exchangeName, functionInfo);

            SendToStatusBar(keyE, info);
            if (this.IsEnabled())
            {
                this.WriteEvent(303, exchangeName, functionInfo, memberName, sourceFilePath, sourceLineNumber);
            }
        }
Ejemplo n.º 16
0
        public void UpdateSetting(string message, [CallerMemberName] string memberName = "", [CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = -1)
        {
            KeyE   keyE = new KeyE(2, 2);//黄
            string info = string.Format(Resources.ConfigOption + ":“{0}”," + Resources.TakeEffectAfterRestart, message);

            SendToStatusBar(keyE, info);
            if (this.IsEnabled())
            {
                this.WriteEvent(302, message, memberName, sourceFilePath, sourceLineNumber);
            }
        }
Ejemplo n.º 17
0
        public void RegisterAuthFail(string message, [CallerMemberName] string memberName = "", [CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = -1)
        {
            KeyE   keyE = new KeyE(2, 3); //红
            string info = string.Format(Resources.AuthorizeFail + ":“{0}”", message);

            SendToStatusBar(keyE, info);
            if (this.IsEnabled())
            {
                this.WriteEvent(301, message, memberName, sourceFilePath, sourceLineNumber);
            }
        }
Ejemplo n.º 18
0
        public void DownloadDataAsyncError(string dataType, string exchangeName, string pairCode, string errorMessage, [CallerMemberName] string memberName = "", [CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = -1)
        {
            KeyE   keyE = new KeyE(3, 1);
            string info = string.Format(Resources.DownloadDataAsyncError, dataType, exchangeName, pairCode, errorMessage);

            SendToStatusBar(keyE, info);
            if (this.IsEnabled())
            {
                this.WriteEvent(502, dataType, exchangeName, pairCode, errorMessage, memberName, sourceFilePath, sourceLineNumber);
            }
        }
Ejemplo n.º 19
0
        public void CancelOrderException(string exchangeName, string orderId, string exceptionMessage, [CallerMemberName] string memberName = "", [CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = -1)
        {
            KeyE   keyE = new KeyE(2, 2);
            string info = string.Format(Resources.CancelOrderException, exchangeName, orderId, exceptionMessage);

            SendToStatusBar(keyE, exceptionMessage);
            if (this.IsEnabled())
            {
                this.WriteEvent(1203, exchangeName, orderId, exceptionMessage, memberName, sourceFilePath, sourceLineNumber);
            }
        }
Ejemplo n.º 20
0
        public void Warn(string message, [CallerMemberName] string memberName = "", [CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = -1)
        {
            KeyE   keyE = new KeyE(2, 2);//黄
            string info = string.Format(Resources.WarnInfo + ":“{0}”", message);

            SendToStatusBar(keyE, message);
            if (this.IsEnabled())
            {
                this.WriteEvent(102, message, memberName, sourceFilePath, sourceLineNumber);
            }
        }
Ejemplo n.º 21
0
    private void Update()
    {
        if (Vector3.Distance(Player1.transform.position, Hammer.transform.position) < 1f)
        {
            KeyE.SetActive(true);

            if (!_player1OneTime)
            {
                _player1OneTime = true;
                StartCoroutine(DelayedSetActive(KeyQ));
            }
        }

        if (Vector3.Distance(Player2.transform.position, Hammer.transform.position) < 1f)
        {
            KeyEnter.SetActive(true);

            if (!_player2OneTime)
            {
                _player2OneTime = true;
                StartCoroutine(DelayedSetActive(Key0));
            }
        }
    }