The pieces manager for puzzle game example.
Inheritance: MapGeneralObject
Beispiel #1
0
        ///////////////////////////////////////////

        public JigsawPuzzleManager()
        {
            if (instance != null)
            {
                Log.Fatal("JigsawPuzzleManager: instance already created.");
            }
            instance = this;
        }
Beispiel #2
0
        /// <summary>Overridden from <see cref="Engine.EntitySystem.Entity.OnDestroy()"/>.</summary>
        protected override void OnDestroy()
        {
            base.OnDestroy();

            DestroyBackgroundImageMeshObject();

            if (EntitySystemWorld.Instance.IsServer() || EntitySystemWorld.Instance.IsSingle())
            {
                ServerOrSingle_DestroyPuzzles();
            }

            if (instance == this)             //for undo support
            {
                instance = null;
            }
        }
Beispiel #3
0
        /// <summary>Overridden from <see cref="Engine.EntitySystem.Entity.OnPostCreate(Boolean)"/>.</summary>
        protected override void OnPostCreate(bool loaded)
        {
            instance = this;            //for undo support

            base.OnPostCreate(loaded);

            AddTimer();

            //generate puzzles
            if (EntitySystemWorld.Instance.IsServer() || EntitySystemWorld.Instance.IsSingle())
            {
                ServerOrSingle_GeneratePuzzles(new Vec2i(8, 6));
            }

            CreateBackgroundImageMeshObject();
        }
 ///////////////////////////////////////////
 public JigsawPuzzleManager()
 {
     if( instance != null )
         Log.Fatal( "JigsawPuzzleManager: instance already created." );
     instance = this;
 }
        /// <summary>Overridden from <see cref="Engine.EntitySystem.Entity.OnPostCreate(Boolean)"/>.</summary>
        protected override void OnPostCreate( bool loaded )
        {
            instance = this;//for undo support

            base.OnPostCreate( loaded );

            AddTimer();

            //generate puzzles
            if( EntitySystemWorld.Instance.IsServer() || EntitySystemWorld.Instance.IsSingle() )
                ServerOrSingle_GeneratePuzzles( new Vec2i( 8, 6 ) );

            CreateBackgroundImageMeshObject();
        }
        /// <summary>Overridden from <see cref="Engine.EntitySystem.Entity.OnDestroy()"/>.</summary>
        protected override void OnDestroy()
        {
            base.OnDestroy();

            DestroyBackgroundImageMeshObject();

            if( EntitySystemWorld.Instance.IsServer() || EntitySystemWorld.Instance.IsSingle() )
                ServerOrSingle_DestroyPuzzles();

            if( instance == this )//for undo support
                instance = null;
        }