Table of Contents

Class SkillFactory

Namespace
GrindFest
Assembly
GrindFest.dll

Creates skill instances by CLR type. Skills are plain classes now, so "learning" a skill is a new — the type is what a save / drop table / book stores.

Type names are resolved against every loaded assembly once, so both the simple name ("Fireball") and the full name ("GrindFest.Fireball") work without an assembly qualifier — the failure mode the previous attempt hit with Type.GetType.

public static class SkillFactory
Inheritance
object
SkillFactory

Properties

AllTypes

All skill types that exist, in a stable order (used by tools and tests).

Methods

Create(string)

Creates a skill instance by simple or full name. Null when the name is unknown — and then it is reported (once per distinct reference), because a caller that built data naming a skill is broken whether or not it happens to check for null.

Create(Type)

Creates a skill instance by type. Null when the type is not a skill.

Resolve(string)

Resolves a skill type by simple or full name. Null when unknown.

ResolveReference(string)

Resolves a skill from whatever a save, drop table or old prefab field happens to hold: a type name (Fireball), a full name, or a prefab/asset address such as Assets/_GrindFest/Prefabs/Skill Prefabs/Spells/Mass Transmute Into Gold.prefab.