如何检查实例类是否等于类中的变量?
public class ChainType
{
public ChainType none;
public ChainType unknown;
public ChainType horizontal;
public ChainType vertical;
public ChainType centerCross;
public ChainType leftTopCornerCross;
public ChainType rightTopCornerCross;
public ChainType leftBottomCornerCross;
public ChainType rightBottomCornerCross;
}
public class aClass{
ChainType chainType = new ChainType();
someMethod(){
chainType = getChainType(); // sets to chainType.horizontal
if(chainType == ChainType.horizontal){..} // getting Error here about object reference to non-static class
}
}