Pure Insanity
Sorceror
This is a rather minor suggestion, and won't effect anything that's already out there. It would simply allow other developers to use a foreach loop on the Skills class. The edits needed for this are indeed minimal.
Files effected: Skills.cs
Find this
Change it to this.
And within the same class (directly under the OnSkillChange() method will works fine) add this.
This makes it possible for you to use a loop such as this.
Nothing major, just something that sorta drives me crazy. It's a mod that I've been using for a while now, don't see why everyone else shouldn't be able to do the same. =D
Note: If anyone decides to do this themselves, this does require that you build a new core.
Files effected: Skills.cs
Find this
Code:
[PropertyObject]
public class Skills
Change it to this.
Code:
[PropertyObject]
public class Skills : IEnumerable<Skill>
And within the same class (directly under the OnSkillChange() method will works fine) add this.
Code:
public IEnumerator<Skill> GetEnumerator()
{
foreach (Skill skill in m_Skills)
{
yield return skill;
}
}
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
This makes it possible for you to use a loop such as this.
Code:
foreach (Skill skill in from.Skills)
{
// Set skill to 42
}
Nothing major, just something that sorta drives me crazy. It's a mod that I've been using for a while now, don't see why everyone else shouldn't be able to do the same. =D
Note: If anyone decides to do this themselves, this does require that you build a new core.