RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Explicit operator for SkillInfo

Irian

Page
Just a little idea to make SkillName -> SkillInfo casting possible...

Code:
public static explicit operator SkillInfo(SkillName name)
{
     return Table[(int)name];
}

This way, you could, for example, simply write...
Code:
SkillInfo info = (SkillInfo)SkillName.Alchemy;
 

Jeff

Lord
Seems goofy since you just need to do....
Code:
SkillInfo info = SkillInfo.Table[(int)name];
Also, why would it be explicit? Why not implicit?
 
Top