예제 #1
0
        /// <summary>
        /// Remove <see cref="IJCIWGameComponent"/>.
        /// </summary>
        /// <param name="gameComponent">The <see cref="IJCIWGameComponent"/>.</param>
        public void RemoveGameComponent(IJCIWGameComponent gameComponent)
        {
            lock (gameComponentsAfter)
            {
                if (gameComponentsAfter.Contains(gameComponent))
                {
                    gameComponentsAfter.Remove(gameComponent);
                }
            }

            lock (gameComponentsBefore)
            {
                if (gameComponentsBefore.Contains(gameComponent))
                {
                    gameComponentsBefore.Remove(gameComponent);
                }
            }
        }
예제 #2
0
        /// <summary>
        /// Add new <see cref="IJCIWGameComponent"/>.
        /// </summary>
        /// <param name="gameComponent">The <see cref="IJCIWGameComponent"/>.</param>
        /// <param name="drawOrder">The <see cref="DrawOrder"/>.</param>
        public void AddGameComponent(IJCIWGameComponent gameComponent, DrawOrder drawOrder)
        {
            if (drawOrder == DrawOrder.AfterGUI)
            {
                lock (gameComponentsAfter)
                {
                    gameComponentsAfter.Add(gameComponent);
                }
            }
            else
            {
                if (drawOrder == DrawOrder.BeforeGUI)
                {
                    lock (gameComponentsBefore)
                    {
                        gameComponentsBefore.Add(gameComponent);
                    }
                }
            }

            gameComponent.Initialize(Window.GraphicsDevice);
        }
예제 #3
0
파일: Frame.cs 프로젝트: j0nat/JCIW
 public void RemoveGameComponent(IJCIWGameComponent gameComponent)
 {
     graphics.RemoveGameComponent(gameComponent);
 }
예제 #4
0
파일: Frame.cs 프로젝트: j0nat/JCIW
 public void AddGameComponent(IJCIWGameComponent gameComponent, DrawOrder drawOrder)
 {
     graphics.AddGameComponent(gameComponent, drawOrder);
 }