I've different classes (e.g.: Player, Enemy, Asteroids...) - that are supposed to have one of different statuses (e.g.: ok, teleporting...).
enum Status
{
Ok,
Teleporting,
...
};
Using an interface, I'd like to force those classes to declare only the existance of a enum status variable inside them. However, I want no constraints on values. That is, a Player and an Enemy can have different values inside status (e.g.: one can teleport, the other one can't).
How can I do that?
Update1
public enum Status
{
Ok,
Teleporting
};
public interface IHaveStatus
{
Status Status { get; set; }
}
Update 2
public enum Status
{
Ok,
Teleporting
};
public interface IHaveStatus
{
Status status;
}