XNA - Inconsistent accessibility: parameter type is less accessible than method
- by DijkeMark
I have a level class in which I make a new turret. I give the turret the level class as parameter. So far so good.
Then in the Update function of the Turret I call a function Shoot(), which has that level parameter it got at the moment I created it.
But from that moment it gives the following error:
Inconsistent accessibility: parameter type 'Space_Game.Level' is less accessible than method 'Space_Game.GameObject.Shoot(Space_Game.Level, string)'
All I know it has something to do with not thr right protection level or something like that.
The level class:
public Level(Game game, Viewport viewport)
{
_game = game;
_viewport = viewport;
_turret = new Turret(_game, "blue", this);
_turret.SetPosition((_viewport.Width / 2).ToString(), (_viewport.Height / 2).ToString());
}
The Turret Class:
public Turret(Game game, String team, Level level)
:base(game)
{
_team = team;
_level = level;
switch (_team)
{
case "blue":
_texture = LoadResources._blue_turret.Texture;
_rows = LoadResources._blue_turret.Rows;
_columns = LoadResources._blue_turret.Columns;
_maxFrameCounter = 10;
break;
default:
break;
}
_frameCounter = 0;
_currentFrame = 0;
_currentFrameMultiplier = 1;
}
public override void Update()
{
base.Update();
SetRotation();
Shoot(_level, "turret");
}
The Shoot Function (Which is in GameObject class. The Turret Class inherited the GameObject Class. (Am I saying that right?)):
protected void Shoot(Level level, String type)
{
MouseState mouse = Mouse.GetState();
if (mouse.LeftButton == ButtonState.Pressed)
{
switch (_team)
{
case "blue":
switch (type)
{
case "turret":
TurretBullet _turretBullet = new TurretBullet(_game, _team);
level.AddProjectile(_turretBullet);
break;
default:
break;
}
break;
default:
break;
}
}
}
Thanks in Advance,
Mark Dijkema