public Game(IMonsterFactory factory) { gamer = new Hero(); // герой, за которого играем //Список комнат в локации Room[] rooms = new Room[] { new Room(), new Room(), new Room() }; //Список сокровищ в локации Treasure[] treasures = new Treasure[] { new Treasure(), new Treasure(), new Treasure() }; IMonster[] monsters = new IMonster[50]; // Список монстров в локации for (int i = 0; i < monsters.Length; i++) { monsters[i] = factory.Create(); // задаем тип монстра } location = new Dangeon(monsters, rooms, treasures); // инициализация игровой локации }
static void Main(string[] args) { IMonsterFactory[] lvls = new IMonsterFactory[] { new EasyLevelMonsterFactory(), new MiddleLevelMonsterFactory(), new HardLevelMonsterFactory() }; Console.WriteLine("Выберите уровень сложности и введите его номер."); // Выведем все уровни сложности пользователю for (int i = 0; i < lvls.Length; i++) { Console.WriteLine($"{i+1}.{lvls[i].ToString()}"); } int lvlNumber = Convert.ToInt32(Console.ReadLine()) - 1; if (lvlNumber > -1 && lvlNumber < lvls.Length) { Game game = new Game(lvls[lvlNumber]); // создаем игру game.StartGame(); } else { Console.WriteLine("Указанный уровень отсутствует."); } Console.ReadKey(); // Задержка экрана. }
/// <summary> /// Creates a new <see cref="MapFactory"/> instance. /// </summary> /// <param name="logger"></param> /// <param name="serviceProvider"></param> /// <param name="npcFactory"></param> public MapFactory(ILogger <MapFactory> logger, IServiceProvider serviceProvider, INpcFactory npcFactory, IItemFactory itemFactory, IMonsterFactory monsterFactory) { _logger = logger; _serviceProvider = serviceProvider; _npcFactory = npcFactory; _itemFactory = itemFactory; _monsterFactory = monsterFactory; }
public StoryMaker(IRoomFactory roomFactory, IMonsterFactory monsterFactory, ILootFactory lootFactory) { _roomFactory = roomFactory; _monsterFactory = monsterFactory; _lootFactory = lootFactory; }
public CreateMonsterInteractor( IMonsterRepository monsterRepository, IMonsterFactory monsterFactory ) { _monsterRepository = monsterRepository; _monsterFactory = monsterFactory; }
public static IMonsterFactory Instance(IList <IMonsterType> monsterType = null) { if (instance == null) { instance = new MonsterFactory(monsterType); } return(instance); }
public static IMonsterFactory Instance() { if (instance == null) { instance = new MonsterFactory(); } return(instance); }
public MonsterService(IMonsterRepository monsterRepository, ISlackWebApi slack, IUserService userService, IInventoryRepository inventoryRepository, IRandomService randomService, IMonsterFactory monsterFactory, IChannelRepository channelRepository) { _monsterRepository = monsterRepository; _slack = slack; _userService = userService; _inventoryRepository = inventoryRepository; _randomService = randomService; _monsterFactory = monsterFactory; _channelRepository = channelRepository; }
public CombatEngine(GameWorld gameWorld, IMonsterFactory monsterFactory, ICombatantSelector combantSelector, IDice dice) { _gameWorld = gameWorld; _combantSelector = combantSelector; _dice = dice; _combatContext = new CombatContext(); _combatContext.Player = _gameWorld.Player; _combatContext.Monster = monsterFactory.CreateMonster(_gameWorld, _combatContext); _combatContext.Player.HasFledCombat = false; _combatContext.Monster.HasFledCombat = false; }
public BatchSpaceObjectFactory( IRandomGenerator randomGenerator, IMonsterFactory monsterFactory, IPlanetFactory planetFactory, int probPlanet) { this.randomGenerator = randomGenerator; this.monsterFactory = monsterFactory; this.planetFactory = planetFactory; this.probPlanet = probPlanet; }
public MonsterGroup(TimeSpan spawnTime, MonsterType monsterType, int count, IMonsterFactory factory) { this.SpawnTime = spawnTime; this.MonsterType = monsterType; this.Count = count; this.Finished = false; this.factory = factory; this.timeElapsedSinceLastAddedGameObject = new TimeSpan(); this.monsters = this.CreateMonsters(factory); this.enumerator = this.monsters.GetEnumerator(); }
public MonsterWave(TimeSpan spawnTime, IMonsterFactory factory) { this.SpawnTime = spawnTime; this.Finished = false; this.Level = 1; this.Groups = this.CreateGroups(); this.factory = factory; this.timeElapsedSinceLastGroupFinished = new TimeSpan(); this.enumerator = this.Groups.GetEnumerator(); this.enumerator.MoveNext(); }
public MonsterManualViewModel(IMonsterFactory monsterFactory, IMonsterApi monsterApi) { _monsterFactory = monsterFactory; _monsterApi = monsterApi; Messenger.Default.Register <MessageWindowResponse>(this, "ReloadMonster", msg => { if (msg.Response) { GetMonsterDetails(); } }); GetMonsters(); }
public StoryElements(IMonsterFactory monsterFactory, ILootFactory lootFactory, IRoomFactory roomFactory) { if (monsterFactory == null) { throw new ArgumentNullException("A monsterFactory must be supplied"); } if (lootFactory == null) { throw new ArgumentNullException("A lootFactory must be supplied"); } if (roomFactory == null) { throw new ArgumentNullException("A roomFactory must be supplied"); } this.monsterFactory = monsterFactory; this.lootFactory = lootFactory; this.roomFactory = roomFactory; }
public Graveyard(IMonsterFactory factory) { _monsterFactory = factory; }
public MonsterService(IWebDriver webDriver, IMonsterFactory monsterFactory) { _monsterFactory = monsterFactory; _webDriver = webDriver; }
/// <summary> /// Метод - конструктор, где создаются объекты при помощи фабрики /// </summary> public Monster(IMonsterFactory factory) { _weapon = factory.CreateWeapon(); _movement = factory.CreateMovement(); }
public HallwayFactory(IMonsterFactory iMonsterFactory) { _iMonsterFactory = iMonsterFactory; }
public InitialMonsterWave(TimeSpan spawnTime, IMonsterFactory factory) : base(spawnTime, factory) { }
public MonsterRepository(DougContext db, IMonsterFactory monsterFactory) { _db = db; _monsterFactory = monsterFactory; }
protected virtual IEnumerable <IMonster> CreateMonsters(IMonsterFactory factory) { return(Enumerable.Repeat <MonsterType>(this.MonsterType, this.Count).Select(type => factory.CreateMonster(type))); }
public void LoadMonster(IMonsterFactory monsterFactory) { Monster = monsterFactory.CreateMonster(MonsterId); Monster.Health = Health; }
public AddMonsterCommand(IRepository <IMonster> monsterRepository, IMonsterFactory monsterFactory) { this.monsterRepository = monsterRepository; this.monsterFactory = monsterFactory; }
public MonsterFactoryTest() { _monsterFactory = new MonsterFactory(); }
public AddMonsterCommand(IRepository <IMonster> repository, IMonsterFactory factory) { this.repository = repository; this.factory = factory; }
/// <summary> /// Creates a new <see cref="CreateMonsterChatCommand"/> instance. /// </summary> /// <param name="logger">Logger.</param> /// <param name="monsterFactory">Monster factory.</param> public CreateMonsterChatCommand(ILogger <CreateMonsterChatCommand> logger, IMapManager mapManager, IMonsterFactory monsterFactory) { _logger = logger; _monsterFactory = monsterFactory; }