Пример #1
0
        private GameContext()
        {
            randomNumberGenerator  = new SystemRandomNumberGenerator();
            tagFactory             = new TagFactory(randomNumberGenerator);
            itemFactory            = new ItemFactory(tagFactory);
            jsonItemListFactory    = new JsonItemListFactory(itemFactory);
            characterNameGenerator = new CharacterNameGenerator(randomNumberGenerator);
            CharacterSafeCodeGenerator characterSafeCodeGenerator = new CharacterSafeCodeGenerator(randomNumberGenerator);

            characterFactory = new CharacterFactory(randomNumberGenerator, itemFactory, tagFactory, characterNameGenerator, characterSafeCodeGenerator);
            roomFactory      = new RoomFactory(characterFactory, itemFactory, randomNumberGenerator);
            gameServer       = new GameServer();
        }
 public CharacterFactory(
     RandomNumberGenerator randomNumberGenerator,
     ItemFactory itemFactory,
     TagFactory tagFactory,
     CharacterNameGenerator characterNameGenerator,
     CharacterSafeCodeGenerator characterSafeCodeGenerator
     )
 {
     characters = new List <Character>();
     this.randomNumberGenerator      = randomNumberGenerator;
     this.characterNameGenerator     = characterNameGenerator;
     this.itemFactory                = itemFactory;
     this.tagFactory                 = tagFactory;
     this.characterSafeCodeGenerator = characterSafeCodeGenerator;
 }