@@ -120,14 +120,14 @@ Error ThingFactory::RemoveThing(FPID inType) noexcept
120120
121121Farg<ThingType> ThingFactory::GetType (FPID inType) noexcept
122122{
123- static ThingType sBadType {};
123+ static ThingType sBadType {ThingType::Invalid };
124124 if (auto found_it{m_sAllTypes.find (inType)};
125125 found_it != m_sAllTypes.end ())
126- { return *found_it; }
126+ { return *found_it; }
127127 return sBadType ;
128128}
129129
130- Shared<Thing> ThingFactory::MakeThing (Farg< PID > type)
130+ Shared<Thing> ThingFactory::MakeThing (FPID type)
131131{
132132 if (auto found_it{m_sThingMakers.find (type)}; found_it != m_sThingMakers.end ())
133133 { return found_it->second (); }
@@ -136,45 +136,45 @@ Shared<Thing> ThingFactory::MakeThing(Farg<PID> type)
136136 return ThingMakerTemplate<Thing>();
137137}
138138
139- Shared<Thinker> ThingFactory::MakeThinker (Farg< PID > inTypeID)
139+ Shared<Thinker> ThingFactory::MakeThinker (FPID inTypeID)
140140{
141141 if (!IsThinker (inTypeID))
142142 { return MakeShared<Thinker>(); }
143143 return DCast<Thinker>(MakeThing (inTypeID));
144144}
145145
146- Shared<Resource> ThingFactory::MakeResource (Farg< PID > inTypeID)
146+ Shared<Resource> ThingFactory::MakeResource (FPID inTypeID)
147147{
148148 if (!IsResource (inTypeID))
149149 { return MakeShared<Resource>(); }
150150 return DCast<Resource>(MakeThing (inTypeID));
151151}
152152
153- bool ThingFactory::SetPriority (Farg< PID > type, int priority)
153+ bool ThingFactory::SetPriority (FPID type, int priority)
154154{
155155 if (!IsThing (type))
156156 { return false ; }
157157 m_sTypePriorities[type] = priority;
158158 return true ;
159159}
160160
161- int ThingFactory::GetPriority (Farg< PID > type)
161+ int ThingFactory::GetPriority (FPID type)
162162{
163163 if (auto found_it{m_sTypePriorities.find (type)}; found_it != m_sTypePriorities.end ())
164164 { return m_sTypePriorities.at (type); }
165165 return static_cast <int >(static_cast <uint>(-1 ) / 2 ); // Same as `INT_MAX`
166166}
167167
168- bool ThingFactory::IsThing (Farg< PID > inTypeID)
168+ bool ThingFactory::IsThing (FPID inTypeID)
169169{ return m_sAllTypes.contains (inTypeID); }
170170
171- bool ThingFactory::IsThinker (Farg< PID > inTypeID)
171+ bool ThingFactory::IsThinker (FPID inTypeID)
172172{ return IsDerivedFrom (inTypeID, ThingType::Thinker); }
173173
174- bool ThingFactory::IsResource (Farg< PID > inTypeID)
174+ bool ThingFactory::IsResource (FPID inTypeID)
175175{ return IsDerivedFrom (inTypeID, ThingType::Resource); }
176176
177- bool ThingFactory::IsDerivedFrom (Farg< PID > inTypeID1, Farg< PID > inTypeID2)
177+ bool ThingFactory::IsDerivedFrom (FPID inTypeID1, FPID inTypeID2)
178178{
179179 if (auto found_it{m_sAllTypes.find (inTypeID1)}; found_it != m_sAllTypes.end ())
180180 { return (found_it->type () == inTypeID2 or found_it->is_derived_from (inTypeID2)); }
0 commit comments