 |
Jypeli
9
The simple game programming library
|
Siirry tämän tiedoston dokumentaatioon.
2 using 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 T FactoryCreate< T >(string tag)
static void AddFactory< T >(string tag, FactoryMethod method)
void AddFactory< T >(string tag, Factory.FactoryMethod method)
Luo tehdasmetodin tietylle tyypille ja tagille.
static object FactoryCreate(Type type, string tag)
static void RemoveFactory< T >(string tag, FactoryMethod method)
FactoryKey(Type type, string tag)
T FactoryCreate< T >(string tag)
Käyttää tehdasmetodia uuden olion luomiseen ja palauttaa olion.
static Dictionary< FactoryKey, FactoryMethod > constructors
delegate object FactoryMethod()
void RemoveFactory< T >(string tag, Factory.FactoryMethod method)
Poistaa tehdasmetodin.