Exemple #1
0
        /// <summary>
        /// Create singleton instance.
        /// Auto sets up basic managers
        /// </summary>
        protected GameManager()
        {
            settings           = new PropertiesFiles(".gameprops");
            instance           = this;
            ObjectManager      = new DefaultObjectManager();
            InputManager       = new DefaultInputManager();
            InputSourceManager = new DefaultInputSourceManager();
            LogManager         = DefaultLogManager.Instance;


            HudManager = HudManager.Instance;
            ObjectManager.init();
            InputManager.init();
        }
Exemple #2
0
        /// <summary>
        /// called just after creation.
        /// </summary>
        protected override void Initialize()
        {
            Controller            = this;
            WhiskeyGraphicsDevice = this.GraphicsDevice;

            InputSource = new EditorInputSource(this);
            if (Renderer == null)
            {
                Renderer = new EditorRenderManager();



                Content = new ContentManager(this.Services);
                Content.RootDirectory = "compile-media";
                //Content.RootDirectory = ProjectManager.Instance.ActiveProject.PathMedia;
                Resources = new EditorResourceManager();
                Resources.init(Content);
                Renderer.init(WhiskeyGraphicsDevice);
                //Resources = new DefaultResourceManager();
            }
            if (InputManager == null)
            {
                InputSourceManager = new DefaultInputSourceManager();
                InputManager       = new DefaultInputManager();
                InputManager.init(InputSourceManager);
            }



            //make sure GameManager exists
            //ensureGameManInitialized();



            timer             = Stopwatch.StartNew();
            TargetElapsedTime = new TimeSpan(0, 0, 0, 0, 8);

            //create a new object manager, just for our control objects
            editorObjects = new DefaultObjectManager();
            editorObjects.init();

            //mark this control as the active one


            //construct the object controller, and make sure it resides in the correct object managers
            ObjectController        = new ObjectController(editorObjects);
            ObjectController.Sprite = new Sprite(Renderer, Resources, ObjectController.Sprite);



            //set the current level of the object controller
            if (ObjectController != null)
            {
                ObjectController.CurrentLevel = Level;
            }



            //////////

            setAsActive();
        }
 private CopyPasteManager()
 {
     objects = new DefaultObjectManager();
     objects.init();
 }