Exemplo n.º 1
0
        public void SetSelectedGameObject(DisplayObject selected, BaseEventData pointer)
        {
            if (this._selectionGuard)
            {
                Logger.Error("Attempting to select " + selected + "while already selecting an object.");
                return;
            }

            this._selectionGuard = true;
            if (selected == this._currentSelected)
            {
                this._selectionGuard = false;
                return;
            }

            ExecuteEvents.Execute(this._currentSelected, pointer, EventTriggerType.Deselect);
            this._currentSelected = selected;
            ExecuteEvents.Execute(this._currentSelected, pointer, EventTriggerType.Select);
            this._selectionGuard = false;
        }
Exemplo n.º 2
0
        public Skill GetSkill(string id)
        {
            Skill skill = null;

            if (!string.IsNullOrEmpty(id))
            {
                for (int i = 0; i < this.numSkills; i++)
                {
                    skill = this.skills[i];
                    if (skill.id == id)
                    {
                        break;
                    }
                }
            }
            if (skill == null)
            {
                Logger.Error($"Skill:{id} not exist");
            }
            return(skill);
        }
Exemplo n.º 3
0
        private static void Start(Options opts)
        {
            Console.Title = "BS";
            string logCfg;

            try
            {
                logCfg = File.ReadAllText(opts.logCfg);
            }
            catch (Exception e)
            {
                Logger.Error($"Logger config file load failed,error:{e}");
                return;
            }
            Logger.Init(logCfg, "BS");

            _inputHandler = new InputHandler {
                cmdHandler = HandleInput
            };
            _inputHandler.Start();

            ErrorCode eResult = BS.instance.Initialize(opts);

            if (ErrorCode.Success != eResult)
            {
                Logger.Error($"Initialize BS fail,error code:{eResult}");
                return;
            }
            Logger.Info("BS Initialize success");

            eResult = BS.instance.Start();
            if (ErrorCode.Success != eResult)
            {
                Logger.Error($"Start BS fail, error code:{eResult}");
                return;
            }

            MainLoop();
            _inputHandler.Stop();
        }
Exemplo n.º 4
0
 private void OnLoadError(object sender, string msg, object data)
 {
     Logger.Error(msg);
 }
Exemplo n.º 5
0
 private void OnUnhandledException(object sender, UnhandledExceptionEventArgs e)
 {
     Logger.Error(e.ExceptionObject.ToString());
 }