I have a project in MS Visual Studio 2008 Pro. I am new to the environment and language, so please ask the noobish question.
I have a type ControlCode:
namespace ShipAILab
{
public abstract class ControlUnit {
public enum ControlCode {
NoAction = 0x00,
MoveLeft = 0x01,
MoveUp = 0x02,
MoveRight = 0x04,
MoveDown = 0x08,
Fire = 0x10,
}
}
}
I want this to be available from another class BoardUtilsthat is in the same namespace ShipAILab:
public static IList<ControlUnit.ControlCode> pathToPoint(IDictionary<CompPoint, int> dist, CompPoint destination) {
ControlUnit.ControlCode code = ControlUnit.ControlCode.MoveLeft;
ControlCode c2 = ControlCode.MoveDown;
}
Why does this not work automatically thanks to sharing the namespace? Do I need an operator using? Can I "typedef" as in C rename ControlUnit.ControlCodeto something more compressed?
source
share