示例#1
0
 public Commands(
     IMovement movement,
     IRoomActions roomActions,
     IDebug debug,
     ISkills skills,
     ISpells spells,
     IObject objects,
     IInventory inventory,
     Icommunication communication,
     IEquip equipment,
     IScore score,
     ICombat combat,
     ICache cache,
     ISocials socials,
     ICommandHandler commandHandler
     )
 {
     _movement       = movement;
     _roomActions    = roomActions;
     _debug          = debug;
     _skills         = skills;
     _spells         = spells;
     _object         = objects;
     _inventory      = inventory;
     _communication  = communication;
     _equipment      = equipment;
     _score          = score;
     _combat         = combat;
     _cache          = cache;
     _socials        = socials;
     _commandHandler = commandHandler;
 }
示例#2
0
 public void DebugUpdate(IDebug debug)
 {
     if (_input.Triggered.SpecialLeft)
     {
         Kernel.DebugMode = !Kernel.DebugMode;
     }
 }
示例#3
0
文件: Ever.cs 项目: nihiven/Element
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your managed content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            // texturePacker spriter render class
            this.spriteRender = new SpriteRender(this.spriteBatch);

            /// the master blaster
            Content.RootDirectory = "Content";
            ObjectManager.Add(ComponentStrings.ContentManager, new AssetManager(Content));
            _contentManager = ObjectManager.Get <IContentManager>(ComponentStrings.ContentManager);

            LoadAssets(); // requires content manager

            // create the game components
            AddComponent(ComponentStrings.EntityManager);
            AddComponent(ComponentStrings.Input);
            AddComponent(ComponentStrings.Debug);
            AddComponent(ComponentStrings.ControllerDebug);
            AddComponent(ComponentStrings.ItemManager);
            AddComponent(ComponentStrings.GameOptions);
            AddComponent(ComponentStrings.ActiveGear);
            AddComponent(ComponentStrings.Inventory);
            AddComponent(ComponentStrings.Player);
            AddComponent(ComponentStrings.HUD);
            AddComponent(ComponentStrings.ItemDebug);
            AddComponent(ComponentStrings.GameManager);

            _input           = ObjectManager.Get <IInput>(ComponentStrings.Input);
            _debug           = ObjectManager.Get <IDebug>(ComponentStrings.Debug);
            _controllerDebug = ObjectManager.Get <IControllerDebug>(ComponentStrings.ControllerDebug);
            _itemDebug       = ObjectManager.Get <IItemDebug>(ComponentStrings.ItemDebug);
            _gameManager     = ObjectManager.Get <IGameManager>(ComponentStrings.GameManager);
        }
示例#4
0
 public GameController(IDebug debug, IUiObject uiObject, IGeneticAlgorithm ga, IMainGameObject mainGameObject)
 {
     this.debug          = debug;
     this.uiObject       = uiObject;
     this.ga             = ga;
     this.mainGameObject = mainGameObject;
 }
示例#5
0
        public void DebugDraw(IDebug debug)
        {
            if (_menuState.IsMenuOpen)
            {
                return;
            }

            if (IsDebugMode())
            {
                if (_debugType == 0)
                {
                    DebugDrawEntities(debug);
                }
                else if (_debugType == 1)
                {
                    DebugDrawPlaceList(debug);
                }
                else if (_debugType == 2)
                {
                    debug.Println("Press X to return to title screen");
                }
            }
            else
            {
                debug.Println($"MAP: {Constants.WorldIds[_worldId]}{_placeId:D02}");
                debug.Println($"POS ({_camera.CameraPosition.X:F0}, {_camera.CameraPosition.Y:F0}, {_camera.CameraPosition.Z:F0})");
                debug.Println($"YPR ({_camera.CameraRotationYawPitchRoll.X:F0}, {_camera.CameraRotationYawPitchRoll.Y:F0}, {_camera.CameraRotationYawPitchRoll.Z:F0})");
            }
        }
示例#6
0
 public void AddObjToDebugList(IDebug component)
 {
     if (!_debugList.Contains(component))
     {
         _debugList.Add(component);
     }
 }
示例#7
0
文件: MapState.cs 项目: gjgfuj/OpenKh
 public void DebugUpdate(IDebug debug)
 {
     if (_input.IsDebug)
     {
         Kernel.DebugMode = !Kernel.DebugMode;
     }
 }
示例#8
0
 public RpcBlockReader(
     IWeb3 web3,
     IDebug debug)
 {
     _client = web3;
     _debug  = debug;
 }
示例#9
0
        private void FindDebugger(double rate)
        {
            int    retries  = 10;
            IDebug debugger = null;

            do
            {
                debugger = ScenePrivate.FindReflective <IDebug>("Simple.Debugger").FirstOrDefault();
                if (debugger == null)
                {
                    Wait(rate);
                }
            } while (debugger == null && --retries > 0);

            if (debugger != null)
            {
                __SimpleDebugger = debugger;
                return;
            }

            if (rate < 3.0)
            {
                StartCoroutine(() =>
                {
                    FindDebugger(rate * 2);
                });
            }
        }
示例#10
0
 public static void LinkDebug(IDebug debug)
 {
     if (debug != null)
     {
         _debug = debug;
     }
 }
示例#11
0
        /// <summary>
        /// Initializes a new instance of the <see cref="WireSentry.CachedDnsProvider"/> class.
        /// </summary>
        /// <param name='debugger'>
        /// The debugger instance to use for debug output.
        /// </param>
        public CachedDnsProvider(IDebug debugger)
        {
            _lock = new ReaderWriterLockSlim();

            Debugger  = debugger;
            Hashtable = new StringDictionary();
        }
示例#12
0
        public void DebugDraw(IDebug debug)
        {
            if (_menuState.IsMenuOpen)
            {
                return;
            }

            if (IsDebugMode())
            {
                if (_debugType == 0)
                {
                    DebugDrawEntities(debug);
                }
                else if (_debugType == 1)
                {
                    DebugDrawPlaceList(debug);
                }
                else if (_debugType == 2)
                {
                    debug.Println("Press X to return to title screen");
                }
            }
            else
            {
                debug.Println($"MAP: {Kh2.Constants.WorldIds[Kernel.World]}{Kernel.Area:D02}");
                debug.Println($"POS ({_camera.CameraPosition.X:F0}, {_camera.CameraPosition.Y:F0}, {_camera.CameraPosition.Z:F0})");
                debug.Println($"LKT ({_camera.CameraLookAt.X:F0}, {_camera.CameraLookAt.Y:F0}, {_camera.CameraLookAt.Z:F0})");
            }
        }
示例#13
0
 public static void SetDebug(IDebug debug)
 {
     if (_debug == null)
     {
         _debug = debug;
     }
 }
示例#14
0
        public LaunchController(IGuiHost host, ControllerConfig config, [NotNull] IDebug debug,
                                [NotNull] UserSettings settings)
        {
            if (host == null)
            {
                throw new ArgumentNullException("host");
            }
            this.host = host;

            if (config == null)
            {
                throw new ArgumentNullException("config");
            }
            if (debug == null)
            {
                throw new ArgumentNullException("debug");
            }
            if (settings == null)
            {
                throw new ArgumentNullException("settings");
            }
            this.config   = config;
            this.debug    = debug;
            this.settings = settings;

            var updaterGui = new UpdaterGui(host, debug);

            host.SetContent(updaterGui);

            gui = updaterGui;
        }
 /// <summary>
 /// Handles all messages sent to this spawn point with a bool in the message
 /// </summary>
 /// <param name="MSG">the message</param>
 /// <param name="OBJ">the object to be used</param>
 public void OnMessageRecieved(string MSG, bool T_F)
 {
     IDebug.DebugVerbose("\"" + this.name + "\" has recieved a message: \"" + MSG + "\" with bool \"" + T_F + "\".");
     if (MSG == "HIGHLIGHT")
     {
         HIGHLIGH_MSG(T_F);
     }
 }
 /// <summary>
 /// Handles all messages sent to this spawn point with gameobjects in the message
 /// </summary>
 /// <param name="MSG">the message</param>
 /// <param name="OBJ">the object to be used</param>
 public void OnMessageRecieved(string MSG, GameObject OBJ)
 {
     IDebug.DebugVerbose("\"" + this.name + "\" has recieved a message: \"" + MSG + "\" with gameobject \"" + OBJ.name + "\".");
     if (MSG == "SPAWN_TOWER")
     {
         SPAWNTOWER_MSG(OBJ);
     }
 }
示例#17
0
 public UpdaterGui(IGuiHost host, [NotNull] IDebug debug)
     : this()
 {
     if (host == null) throw new ArgumentNullException("host");
     if (debug == null) throw new ArgumentNullException("debug");
     this.host = host;
     this.debug = debug;
 }
示例#18
0
        /// <summary>
        /// Initializes a new instance of the <see cref="WireSentry.MySqlLogger"/> class.
        /// </summary>
        /// <param name='debugger'>
        /// The debugger instance to use for output.
        /// </param>
        /// <param name='connectionString'>
        /// The database's connection string.
        /// </param>
        public MySqlLogger(IDebug debugger, string connectionString)
        {
            //Ensure that only one database write occurs at a time.
            _semaphore = new Semaphore(1, 1);

            Debugger   = debugger;
            Connection = new MySqlConnection(connectionString);
        }
示例#19
0
        /// <summary>
        /// Initializes a new instance of the <see cref="WireSentry.MySqlLogger"/> class.
        /// </summary>
        /// <param name='debugger'>
        /// Debugger.
        /// </param>
        /// <param name='connection'>
        /// Connection.
        /// </param>
        public MySqlLogger(IDebug debugger, MySqlConnection connection)
        {
            //Ensure that only one database write occurs at a time.
            _semaphore = new Semaphore(1, 1);

            Debugger   = debugger;
            Connection = connection;
        }
示例#20
0
 void Init()
 {
     instance = this;
     if (log == null)
     {
         log = GetComponent <Text>();
     }
     log.enabled = showLog;
 }
 /// <summary>
 /// Handles all messages recieved with a vector in the message
 /// </summary>
 /// <param name="MSG">The message</param>
 /// <param name="POS">The position attached to the message</param>
 public void OnRecieveMessage(string MSG, Vector3 POS, TowerSpawnPoint TSP)
 {
     IDebug.DebugVerbose("\"" + this.name + "\" has recieved a message: \"" + MSG + "\" with vector \"" + POS + "\".");
     m_currentTowerSpawnPoint = TSP;
     if (MSG == "MOVE_TOWER_UI")
     {
         MOVETOWERUI(POS);
     }
 }
示例#22
0
 public static void InitializeServices(IServiceProvider serviceProvider)
 {
     KeyboardInput   = (IKeyboardInput)serviceProvider.GetService(typeof(IKeyboardInput));
     MouseInput      = (IMouseInput)serviceProvider.GetService(typeof(IMouseInput));
     CursorManager   = (ICursorManager)serviceProvider.GetService(typeof(ICursorManager));
     GraphicsManager = (IGraphicsManager)serviceProvider.GetService(typeof(IGraphicsManager));
     ResourceManager = (IResourceManager)serviceProvider.GetService(typeof(IResourceManager));
     Debug           = (IDebug)serviceProvider.GetService(typeof(IDebug));
 }
 private void Start()
 {
     rend = GetComponent <Renderer>();
     if (rend == null)
     {
         IDebug.LogError("\"" + this.name + "\" could not find its renderer.");
         return;
     }
     startColor = rend.material.color;
 }
示例#24
0
        /// <summary>
        /// Initializes a new instance of the <see cref="WireSentry.ModuleManager"/> class.
        /// </summary>
        /// <param name='debugger'>
        /// The debugger instance to use for debug output.
        /// </param>
        public ModuleManager(IDebug debugger)
        {
            Debugger      = debugger;
            HandlerList   = new Dictionary <Guid, Handler>();
            ScannerList   = new Dictionary <Guid, Scanner>();
            ScheduledList = new Dictionary <Guid, DateTime>();

            Scheduler          = new System.Timers.Timer();
            Scheduler.Interval = SCHEDULER_INTERVAL;
            Scheduler.Elapsed += SchedulerElapsed;
        }
示例#25
0
        public static void PrintState(this IDebug self)
        {
            var properties = self.GetInternalState();

            Console.WriteLine("=========================================================================================================");
            foreach (var propertyName in properties.Keys.OrderBy(c => c))
            {
                Console.WriteLine("{0,-50}{1}", propertyName, properties[propertyName]);
            }
            Console.WriteLine("=========================================================================================================");
        }
示例#26
0
        private void DebugDrawPlaceList(IDebug debug)
        {
            debug.Println("MAP SELECTION");
            debug.Println("");

            foreach (var place in _places.Skip(_debugPlaceCursor))
            {
                debug.Print($"{(place.Index == _debugPlaceCursor ? '>' : ' ')} ");
                debug.Print($"{Constants.WorldIds[place.WorldId]}{place.PlaceId:D02} ");
                debug.Println(place.MessageId);
            }
        }
示例#27
0
 public bool CurrentlyAttackable = true; //left public so that other scripts can modify variable
 public override void Awake()
 {
     base.Awake();
     m_health = StartHealth;
     if (m_health <= 0)
     {
         IDebug.LogWarning("Attackable " + m_name + ": m_health is <= 0. Was this on purpose?");
         m_isDead = true;
     }
     m_isDead     = StartDead;
     m_attackable = CurrentlyAttackable;
 }
示例#28
0
        public void DebugUpdate(IDebug debug)
        {
            if (_input.IsDebug)
            {
                if (!IsDebugMode())
                {
                    EnableDebugMode();

                    if (_places == null)
                    {
                        _places = DebugLoadPlaceList();
                    }

                    _debugObjentryCursor = _kernel.ObjEntries
                                           .Select((entry, i) => new { entry, i })
                                           .FirstOrDefault(x => x.entry.ObjectId == _objEntryId)?.i ?? 0;
                }
                else
                {
                    DisableDebugMode();
                }
            }

            if (IsDebugMode())
            {
                if (_input.IsMenuLeft)
                {
                    _debugType--;
                }
                else if (_input.IsMenuRight)
                {
                    _debugType++;
                }
                _debugType %= 3;

                if (_debugType == 0)
                {
                    DebugUpdatePlaceList();
                }
                else if (_debugType == 1)
                {
                    DebugUpdateObjentryList();
                }
                else if (_debugType == 2)
                {
                    if (_input.IsCross)
                    {
                        debug.State = 0;
                    }
                }
            }
        }
示例#29
0
        public sealed override void Init()
        {
            __SimpleTag = GetType().Name + " [S:" + Script.ID.ToString() + " O:" + ObjectPrivate.ObjectId.ToString() + "]";
            Wait(TimeSpan.FromSeconds(1));
            IDebug debugger = ScenePublic.FindReflective <IDebug>("Simple.Debugger").FirstOrDefault();

            if (debugger != null)
            {
                __SimpleDebugging = debugger.DebugSimple;
            }

            SimpleInit();
        }
示例#30
0
        public Render(IServiceProvider serviceProvider, GraphicsDevice graphicsDevice)
            : base(graphicsDevice)
        {
            SpriteBatch = (SpriteBatch)this;

            graphicsManager = (IGraphicsManager)serviceProvider.GetService(typeof(IGraphicsManager));
            debug           = (IDebug)serviceProvider.GetService(typeof(IDebug));

            baseViewport = GraphicsDevice.Viewport;

            LoadPixel();
            pixel.ContentLost += new EventHandler <EventArgs>(renderTarget_ContentLost);
        }
示例#31
0
    public GesturesStrategy(Gestures gestures, KnobArranger knobArranger, IDebug debug)
    {
        this.knobArranger = knobArranger;
        this.debug        = debug;
        this.gestures     = gestures;

        // move up and out to text writer, use lister interface
        gestures.GestureFor(HandSide.Right).OnGrab    += OnGrab;
        gestures.GestureFor(HandSide.Left).OnGrab     += OnGrab;
        gestures.GestureFor(HandSide.Right).OnRelease += OnRelease;
        gestures.GestureFor(HandSide.Left).OnRelease  += OnRelease;
        gestures.GestureFor(HandSide.Right).OnTouch   += OnTouch;
        gestures.GestureFor(HandSide.Left).OnTouch    += OnTouch;
    }
示例#32
0
        public LaunchController(IGuiHost host, ControllerConfig config, [NotNull] IDebug debug)
        {
            if (host == null) throw new ArgumentNullException("host");
            this.host = host;

            if (config == null) throw new ArgumentNullException("config");
            if (debug == null) throw new ArgumentNullException("debug");
            this.config = config;
            this.debug = debug;

            var updaterGui = new UpdaterGui(host, debug);
            host.SetContent(updaterGui);

            gui = updaterGui;
        }