Error 1 Inconsistent accessibility: parameter type 'G2DBase.Level' is less accessible than method 'G2DBase.Game1.DrawLevel(G2DBase.Level)' C:\Users\Karlovsky\Documents\Visual Studio 2008\Projects\G2DBase\G2DBase\Game1.cs 94 24 G2DBase
I am currently working on a small set of C# and XNA classes/functions to save me time making simple games.
This is the function causing my problem.
protected void DrawLevel(Level L)
{
foreach (ObjectBase O in L.objects)
{
spriteBatch.Draw(O.image, O.position, Color.White);
}
}
other related code
A basic object class
namespace G2DBase
{
class ObjectBase
{
public Vector2 position;
public bool visable;
public bool corporeal;
public Texture2D image;
public ObjectBase(Vector2 Sposition, bool Svisable, bool Scorporeal,Texture2D picture)
{
position = Sposition;
visable = Svisable;
corporeal = Scorporeal;
image = picture;
}
public void Update()
{
}
}
}
A level class. Meant for making simple 2D level objects.
namespace G2DBase
{
class Level
{
public List<ObjectBase> objects;
public int height;
public int width;
public char[] Background;
public Level(int h, int w, char[] BackG)
{
height = h;
width = w;
Background = BackG;
objects = new List<ObjectBase>();
}
public void ParseLevel()
{
}
public void UpdateLevel()
{
foreach (ObjectBase item in objects)
{
item.Update();
}
}
public void DeleteLevel()
{
}
}
}
I am still fairly new to C# as I have never encountered this problem before.
Any help is greatly appreciated.
---------------------------------------------------------------------------------------Exercise, eat right and be the best you can be!Translation: Play video games for finger streangth and eat lots of hot pockets to be at top programming efficiency.