Hi, I've got an issue with protected SceneItem scene = null;
but I can't see why, the error is:
Inconsistent accessibility: field type 'AsteroidsFinal.Helpers.SceneItem' is less accessible than field 'AsteroidsFinal.Helpers.Screen.scene'`
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
namespace AsteroidsFinal.Helpers
{
abstract public class Screen
{
#region Variables
protected SceneItem scene = null;
protected Screen overlay;
protected SpriteBatch batch = null;
protected Game game = null;
#endregion
#region Properties
public Game GameInstance
{
get { return game; }
}
public SpriteBatch Sprites
{
get { return batch; }
}
#endregion
public Screen(AsteroidGame game)
{
this.game = game;
if (game != null)
{
IGraphicsDeviceService graphicsService = (IGraphicsDeviceService)game.Services.GetService(typeof(IGraphicsDeviceService));
this.batch = new SpriteBatch(graphicsService.GraphicsDevice);
}
}
public virtual GameState Update(TimeSpan time, TimeSpan elapsedTime)
{
scene.Update(time, elapsedTime);
return (overlay == null) ? GameState.None : overlay.Update(time, elapsedTime);
}
public virtual void Render()
{
scene.Render();
if (overlay != null)
overlay.Render();
}
public virtual void Shutdown()
{
if (overlay != null)
overlay.Shutdown();
if (batch != null)
{
batch.Dispose();
batch = null;
}
}
public virtual void OnCreateDevice()
{
IGraphicsDeviceService graphicsService = (IGraphicsDeviceService)game.Services.GetService(typeof(IGraphicsDeviceService));
batch = new SpriteBatch(graphicsService.GraphicsDevice);
}
}
}