the error is :
Error 1 Inconsistent accessibility: field type 'TS_Army_Sub.TSStats' is less accessible than field 'TS_Army_Sub.PlayerSub.stats' D:\Uni Work\GHAP\TS Army Sub V1.0\TS Army Sub\PlayerSub.cs 26 24 TS Army Sub
:cursing:
the class TSStats looks like:
using System;
using System.Collections.Generic;
using System.Text;
//kavery
//TSStats (Stats Attemp 2) v1.0
//03-12-2009
namespace TS_Army_Sub
{
class TSStats
{
private int mHealth;
private int mScore;
private int mAirSupply;
public bool aboveWater;
public int health
{
get { return mHealth; }
set { mHealth = value; }
}
public int score
{
get { return mScore; }
set { mScore = value; }
}
private int air
{
get { return mAirSupply; }
set { mAirSupply = value; }
}
public TSStats()
{
mHealth = 250;
mScore = 0;
mmAirsupply = 20;
aboveWater = true;
}
public bool healthCheck()
{
if (mHealth <= 0)
return false;
return true;
}
public void changeScore(int change)
{
mScore += change;
}
}
}
it's fine if i create it like
private TSStats stats;
but i get the error shown above with
public TSStats stats;
and i need it public so that i can ref the health ref for the class handling the gui hud in the game.
is there anything else that needs explaining?
can any tell me why this error appears. or give me a simple solutions,
PS. my original Stats Class had all varibles public and gave the exact same problem which is why i made this one.:confused:


Sign In
Create Account


Back to top









