public GMCreateMobHandler(IGamePacketFactory packetFactory, IGameSession gameSession, IDatabasePreloader databasePreloader, IMovementManager movementManager, IMobFactory mobFactory, IMapProvider mapProvider) : base(packetFactory, gameSession) { _databasePreloader = databasePreloader; _movementManager = movementManager; _mobFactory = mobFactory; _mapProvider = mapProvider; }
public SkillsManager(ILogger <SkillsManager> logger, IGameDefinitionsPreloder definitionsPreloder, IDatabase database, IHealthManager healthManager, IAttackManager attackManager, IBuffsManager buffsManager, IStatsManager statsManager, IElementProvider elementProvider, ICountryProvider countryProvider, ICharacterConfiguration characterConfig, ILevelProvider levelProvider, IAdditionalInfoManager additionalInfoManager, IMapProvider mapProvider, ITeleportationManager teleportationManager, IMovementManager movementManager, IShapeManager shapeManager, IPartyManager partyManager, IGamePacketFactory packetFactory) { _logger = logger; _definitionsPreloder = definitionsPreloder; _database = database; _healthManager = healthManager; _attackManager = attackManager; _buffsManager = buffsManager; _statsManager = statsManager; _elementProvider = elementProvider; _countryProvider = countryProvider; _characterConfig = characterConfig; _levelProvider = levelProvider; _additionalInfoManager = additionalInfoManager; _mapProvider = mapProvider; _teleportationManager = teleportationManager; _movementManager = movementManager; _shapeManager = shapeManager; _partyManager = partyManager; _packetFactory = packetFactory; _levelProvider.OnLevelUp += OnLevelUp; #if DEBUG _logger.LogDebug("SkillsManager {hashcode} created", GetHashCode()); #endif }
public InMemoryGameStateRepository(IMapProvider maps) { if (State.Count == 0) { Guid id = Guid.NewGuid(); State.Add(id, new GameState { Id = id, Turn = 0, Name = "Game 1", MapId = maps.GetRandomMap().Id }); id = Guid.NewGuid(); State.Add(id, new GameState { Id = id, Turn = 0, Name = "Game 2", MapId = maps.GetRandomMap().Id }); id = Guid.NewGuid(); State.Add(id, new GameState { Id = id, Turn = 0, Name = "Game 3", MapId = maps.GetRandomMap().Id }); id = Guid.NewGuid(); State.Add(id, new GameState { Id = id, Turn = 0, Name = "Game 4", MapId = maps.GetRandomMap().Id }); id = Guid.NewGuid(); State.Add(id, new GameState { Id = id, Turn = 0, Name = "Game 5", MapId = maps.GetRandomMap().Id }); id = Guid.NewGuid(); State.Add(id, new GameState { Id = id, Turn = 0, Name = "Game 6", MapId = maps.GetRandomMap().Id }); } }
public SearchPartyHandler(IGamePacketFactory packetFactory, IGameSession gameSession, IGameWorld gameWorld, IPartyManager partyManager, IMapProvider mapProvider, ICountryProvider countryProvider) : base(packetFactory, gameSession) { _gameWorld = gameWorld; _partyManager = partyManager; _mapProvider = mapProvider; _countryProvider = countryProvider; }
/// <summary> /// Creates a new TiledMapProvider using the given Map Provider and the given Cache provider. /// </summary> /// <param name="provider">The Map Provider to initially use.</param> /// <param name="caching">The Cachine provider to use initially.</param> public TiledMapProvider(IMapProvider provider, ITileCachingProvider caching) { _cachingProvider = caching; _download = new DownloadService(); Provider = provider; }
public EnteredMapHandler(IGamePacketFactory packetFactory, IGameSession gameSession, IGameWorld gameWorld, ITeleportationManager teleportationManager, IMapProvider mapProvider, IWarehouseManager warehouseManager) : base(packetFactory, gameSession) { _gameWorld = gameWorld; _teleportationManager = teleportationManager; _mapProvider = mapProvider; _warehouseManager = warehouseManager; }
public Storage( IHash hash, IMapProvider mapProvider, IRepository <MetadataItem, ulong> metadataRepository, IRepository <byte[], ulong> dataRepository) { _hash = hash; _mapProvider = mapProvider; _metadataRepository = metadataRepository; _dataRepository = dataRepository; _metadataCache = new Lazy <IDictionary <byte[], ulong> >(() => { var dictionary = new Dictionary <byte[], ulong>(new ByteArrayEquityComparer()); foreach (var id in _metadataRepository.Ids) { var item = _metadataRepository.GetById(id); dictionary.Add(item.Checksum, id); } return(dictionary); }); _lock = new object(); _disposed = false; }
public MapRenderer(IMapProvider mapProvider) { _mapProvider = mapProvider; _xOffset = GetMinLatitude() - 10f / SCALING_FACTOR; _yOffset = GetMinLongitude() - 10f / SCALING_FACTOR; HighlightedEdges = new List <NodeToNodeEdge>(); }
public IMapProvider GetMapProvider() { if (currentMapProvider == null) { currentMapProvider = PerlinMapProvider.GetInstance(); } return(currentMapProvider); }
public VehicleHandlers(IGamePacketFactory packetFactory, IGameSession gameSession, IVehicleManager vehicleManager, IInventoryManager inventoryManager, IMapProvider mapProvider, ICountryProvider countryProvider, IMovementManager movementManager) : base(packetFactory, gameSession) { _vehicleManager = vehicleManager; _inventoryManager = inventoryManager; _mapProvider = mapProvider; _countryProvider = countryProvider; _movementManager = movementManager; }
public RandomGameFactory(IGameManager gameManager, IMapProvider mapProvider, IEntityFactory foodFactory, IEntityFactory sheepFactory, IEntityFactory wolfFactory) { MapProvider = mapProvider; FoodFactory = foodFactory; SheepFactory = sheepFactory; WolfFactory = wolfFactory; GameManager = gameManager; }
public UseSkillHandlers(IGamePacketFactory packetFactory, IGameSession gameSession, IGameWorld gameWorld, ISkillsManager skillsManager, IAttackManager attackManager, IMapProvider mapProvider, ISkillCastingManager skillCastingManager) : base(packetFactory, gameSession) { _gameWorld = gameWorld; _skillsManager = skillsManager; _attackManager = attackManager; _mapProvider = mapProvider; _skillCastingManager = skillCastingManager; }
public NpcBuyItemHandler(ILogger <NpcBuyItemHandler> logger, IGamePacketFactory packetFactory, IGameSession gameSession, IMapProvider mapProvider, IGameWorld gameWorld, IInventoryManager inventoryManager, IGuildManager guildManager) : base(packetFactory, gameSession) { _logger = logger; _mapProvider = mapProvider; _gameWorld = gameWorld; _inventoryManager = inventoryManager; _guildManager = guildManager; }
public GMCreateNpcHandler(IGamePacketFactory packetFactory, IGameSession gameSession, IGameDefinitionsPreloder definitionsPreloder, IMovementManager movementManager, IMapProvider mapProvider, IGameWorld gameWorld, INpcFactory npcFactory) : base(packetFactory, gameSession) { _definitionsPreloder = definitionsPreloder; _movementManager = movementManager; _mapProvider = mapProvider; _gameWorld = gameWorld; _npcFactory = npcFactory; }
void Start() { IMapProvider <Vector3> columnMapProvider = GetComponentInChildren <IMapProvider <Vector3> >(); columnMap = columnMapProvider.GetMap(); GameController.Instance.OnGameReset.TakeUntilDestroy(this).Subscribe(Bind); }
/// <summary> /// Sets the map provider /// </summary> /// <param name="mapProvider"></param> public virtual void SetMapProvider(IMapProvider mapProvider) { if (MapProvider != null) { return; } MapProvider = mapProvider; }
public MainWindowViewModel(IMapProvider mapProvider, IRouter router, IMapRenderer mapRenderer) { _mapProvider = mapProvider; _router = router; _mapRenderer = mapRenderer; PlanTripCommand = new YaCommand(_ => PlanTrip()); }
public ShopManager(ILogger <ShopManager> logger, IInventoryManager inventoryManager, IMapProvider mapProvider) { _logger = logger; _inventoryManager = inventoryManager; _mapProvider = mapProvider; #if DEBUG _logger.LogDebug("ShopManager {hashcode} created", GetHashCode()); #endif }
public SafetyModule(IDataSource dataSource, IMapProvider mapProvider, IPathProvider pathProvider, VPVehicleController carController, VPStandardInput input) { DataSource = dataSource; _mapProvider = mapProvider; _pathProvider = pathProvider; CarController = carController; Input = input; dataSource.DetectedObstacles += (sender, obstacles) => OnDataFusionArrive(obstacles); }
public SimulationManager( ActorManager actorManager, IMapProvider mapProvider ) { _actors = actorManager; _mapProvider = mapProvider; _thread = new Thread(Run); _gate = new AutoResetEvent(false); _terminated = false; }
public RebirthHandler(IGamePacketFactory packetFactory, IGameSession gameSession, IMapProvider mapProvider, IGameWorld gameWorld, IHealthManager healthManager, ITeleportationManager teleportationManager, IMovementManager movementManager, IBuffsManager buffsManager, IInventoryManager inventoryManager, IGameDefinitionsPreloder definitionsPreloder) : base(packetFactory, gameSession) { _mapProvider = mapProvider; _gameWorld = gameWorld; _healthManager = healthManager; _teleportationManager = teleportationManager; _movementManager = movementManager; _buffsManager = buffsManager; _inventoryManager = inventoryManager; _definitionsPreloder = definitionsPreloder; }
public GameStateProviderTests() { _dummyPlayer = GetDummyPlayer(); _dummyMap = GetDummyMap(); _gameStateRepository = Substitute.For<IGameStateRepository>(); _playersProvider = Substitute.For<IPlayersProvider>(); _playersProvider.Get(Guid.Empty).ReturnsForAnyArgs(_dummyPlayer); _mapProvider = Substitute.For<IMapProvider>(); _mapProvider.GetRandomMap().ReturnsForAnyArgs(_dummyMap); _gameStateProvider = new GameStateProvider(_gameStateRepository, _playersProvider, _mapProvider); }
public GameStateProviderTests() { _dummyPlayer = GetDummyPlayer(); _dummyMap = GetDummyMap(); _gameStateRepository = Substitute.For <IGameStateRepository>(); _playersProvider = Substitute.For <IPlayersProvider>(); _playersProvider.Get(Guid.Empty).ReturnsForAnyArgs(_dummyPlayer); _mapProvider = Substitute.For <IMapProvider>(); _mapProvider.GetRandomMap().ReturnsForAnyArgs(_dummyMap); _gameStateProvider = new GameStateProvider(_gameStateRepository, _playersProvider, _mapProvider); }
public BaseKillable(IDatabasePreloader databasePreloader, ICountryProvider countryProvider, IStatsManager statsManager, IHealthManager healthManager, ILevelProvider levelProvider, IBuffsManager buffsManager, IElementProvider elementProvider, IMovementManager movementManager, IUntouchableManager untouchableManager, IMapProvider mapProvider) { _databasePreloader = databasePreloader; CountryProvider = countryProvider; StatsManager = statsManager; HealthManager = healthManager; LevelProvider = levelProvider; BuffsManager = buffsManager; ElementProvider = elementProvider; MovementManager = movementManager; UntouchableManager = untouchableManager; MapProvider = mapProvider; }
public TeleportHandlers(ILogger <TeleportHandlers> logger, ILogger <Npc> npcLogger, IGamePacketFactory packetFactory, IGameSession gameSession, ITeleportationManager teleportationManager, IMapProvider mapProvider, IGameWorld gameWorld, IGuildManager guildManager, IInventoryManager inventoryManager, IMapsLoader mapLoader, IMoveTownsConfiguration moveTownsConfiguration, ICountryProvider countryProvider) : base(packetFactory, gameSession) { _logger = logger; _npcLogger = npcLogger; _teleportationManager = teleportationManager; _mapProvider = mapProvider; _gameWorld = gameWorld; _guildManager = guildManager; _inventoryManager = inventoryManager; _mapLoader = mapLoader; _moveTownsConfiguration = moveTownsConfiguration; _countryProvider = countryProvider; }
public override void Initialize() { this.mapProvider = null; if (TestUtil.IsPcMrDark) { this.mapProvider = new TestMapProvider(); } if (this.mapProvider == null) { throw new StartupException(MapManagerException.UnableToCreateMapProvider, "Unable to load MapProvider, check configuration."); } }
public Mob(ushort mobId, bool shouldRebirth, MoveArea moveArea, ILogger <Mob> logger, IDatabasePreloader databasePreloader, IAIManager aiManager, IItemEnchantConfiguration enchantConfig, IItemCreateConfiguration itemCreateConfig, ICountryProvider countryProvider, IStatsManager statsManager, IHealthManager healthManager, ILevelProvider levelProvider, ISpeedManager speedManager, IAttackManager attackManager, ISkillsManager skillsManager, IBuffsManager buffsManager, IElementProvider elementProvider, IMovementManager movementManager, IUntouchableManager untouchableManager, IMapProvider mapProvider) : base(databasePreloader, countryProvider, statsManager, healthManager, levelProvider, buffsManager, elementProvider, movementManager, untouchableManager, mapProvider) { _logger = logger; _enchantConfig = enchantConfig; _itemCreateConfig = itemCreateConfig; _dbMob = databasePreloader.Mobs[mobId]; _moveArea = moveArea; AIManager = aiManager; Exp = _dbMob.Exp; ShouldRebirth = shouldRebirth; SpeedManager = speedManager; AttackManager = attackManager; SkillsManager = skillsManager; ElementProvider.ConstAttackElement = _dbMob.Element; ElementProvider.ConstDefenceElement = _dbMob.Element; if (ShouldRebirth) { _rebirthTimer.Interval = RespawnTimeInMilliseconds; _rebirthTimer.Elapsed += RebirthTimer_Elapsed; HealthManager.OnDead += MobRebirth_OnDead; } HealthManager.OnGotDamage += OnDecreaseHP; AIManager.OnStateChanged += AIManager_OnStateChanged; }
public void ShowMap() { var providers = PluginManager.Instance.GetExtensionsOfType <IMapProvider>(); if (providers != null && providers.Count > 0) { _map = providers[0]; if (_map != null) { _map.Show(); UpdateMap(); } } }
public CastProtectionManager(ILogger <CastProtectionManager> logger, IMovementManager movementManager, IPartyManager partyProvider, IGamePacketFactory packetFactory, IGameSession gameSession, IMapProvider mapProvider) { _logger = logger; _movementManager = movementManager; _partyProvider = partyProvider; _packetFactory = packetFactory; _gameSession = gameSession; _mapProvider = mapProvider; _checkProtectCastingSkill.Elapsed += CheckProtectCastingSkill_Elapsed; _checkProtectCastingSkill.Start(); #if DEBUG _logger.LogDebug("CastProtectionManager {hashcode} created", GetHashCode()); #endif }
public PartyManager(ILogger <PartyManager> logger, IGamePacketFactory packetFactory, IGameWorld gameWorld, IMapProvider mapProvider, IHealthManager healthManager) { _logger = logger; _packetFactory = packetFactory; _gameWorld = gameWorld; _mapProvider = mapProvider; _healthManager = healthManager; _summonTimer.Elapsed += OnSummonningFinished; _healthManager.OnGotDamage += CancelSummon; #if DEBUG _logger.LogDebug("PartyManager {hashcode} created", GetHashCode()); #endif }
public LevelingManager(ILogger <LevelingManager> logger, IDatabase database, ILevelProvider levelProvider, IAdditionalInfoManager additionalInfoManager, ICharacterConfiguration charConfig, IDatabasePreloader databasePreloader, IPartyManager partyManager, IMapProvider mapProvider, IMovementManager movementManager) { _logger = logger; _database = database; _levelProvider = levelProvider; _additionalInfoManager = additionalInfoManager; _characterConfig = charConfig; _databasePreloader = databasePreloader; _partyManager = partyManager; _mapProvider = mapProvider; _movementManager = movementManager; #if DEBUG _logger.LogDebug("LevelingManager {hashcode} created", GetHashCode()); #endif }
public ServerWorldManager(IEnumerable<Assembly> eventassemblies, string maproot) { this.mapprovider = new XMLMapProvider (eventassemblies); this.maproot = maproot; }
public void Load(XmlNode worldNode, IMapProvider mapprovider, MapEventManager mapmanager) { foreach (XmlNode node in worldNode.ChildNodes) { if (node.Name == "DefaultSpawn") { this.DefaultSpawn = node.InnerText; } else if (node.Name == "MapLoc") { /* Load the map header from an XML node */ MapHeader header = new MapHeader(); header.MapProvider = new XMLMapProvider(); header.MapManager = mapmanager; int x = 0, y = 0; foreach(XmlNode cnode in node.ChildNodes) { if(cnode.Name == "Name") header.MapName = cnode.InnerText; else if(cnode.Name == "FilePath") header.MapFileLocation = Path.Combine(Environment.CurrentDirectory, "Maps\\" + cnode.InnerText); else if(cnode.Name == "X") x = Convert.ToInt32(cnode.InnerText); else if(cnode.Name == "Y") y = Convert.ToInt32(cnode.InnerText); } header.MapLocation = new MapPoint(x, y); this.MapList.Add(header.MapName, header); } } var worldName = worldNode.Attributes.GetNamedItem("Name"); this.Name = worldName.InnerText; CalcWorldSize(); }
public void Load(XmlNode worldNode, IMapProvider mapprovider) { this.Load(worldNode, mapprovider); }
public void Load(FileInfo WorldConfiguration, IMapProvider mapprovider) { this.Load(WorldConfiguration, mapprovider, null); }
public void Load(FileInfo WorldConfiguration, IMapProvider mapprovider, MapEventManager eventmanager) { XmlDocument doc = new XmlDocument(); doc.Load(WorldConfiguration.FullName); this.FileName = WorldConfiguration.Name; this.FilePath = WorldConfiguration.FullName; XmlNodeList worldNodes = doc.GetElementsByTagName("Worlds"); foreach (XmlNode worldNode in worldNodes[0].ChildNodes) { World world = new World(); world.Load(worldNode, mapprovider, eventmanager); this.WorldsList.Add(world.Name, world); } }
public static Map LoadMap(string path, IMapProvider provider, FileInfo textureinfo) { var map = provider.GetMap(path, MapEditorManager.GameInstance.Engine.EventProvider); map.Texture = GameInstance.Engine.TextureManager.GetTexture((textureinfo == null) ? map.TextureName : textureinfo.Name); return map; }
public ServerWorldManager(IMapProvider mapprovider, string maproot) { this.mapprovider = mapprovider; this.maproot = maproot; }
public GameStateProvider(IGameStateRepository repository, IPlayersProvider playersProvider, IMapProvider mapProvider) { _repo = repository; _playersProvider = playersProvider; _mapProvider = mapProvider; }