2using System.Collections.Generic;
6 public partial class Game
16 Factory.AddFactory<
T>( tag, method );
27 Factory.RemoveFactory<
T>( tag, method );
57 static Dictionary<FactoryKey, FactoryMethod>
constructors =
new Dictionary<FactoryKey, FactoryMethod>();
87 if ( key.
type == type && key.
tag == tag )
91 throw new KeyNotFoundException(
"Key " + tag +
" for class " + type.Name +
" was not found." );
static object FactoryCreate(Type type, string tag)
static T FactoryCreate< T >(string tag)
static Dictionary< FactoryKey, FactoryMethod > constructors
static void AddFactory< T >(string tag, FactoryMethod method)
delegate object FactoryMethod()
static void RemoveFactory< T >(string tag, FactoryMethod method)
void RemoveFactory< T >(string tag, Factory.FactoryMethod method)
Poistaa tehdasmetodin.
T FactoryCreate< T >(string tag)
Käyttää tehdasmetodia uuden olion luomiseen ja palauttaa olion.
void AddFactory< T >(string tag, Factory.FactoryMethod method)
Luo tehdasmetodin tietylle tyypille ja tagille.
FactoryKey(Type type, string tag)