/// <summary> /// Loads a MapSpawnValues from the database. /// </summary> /// <param name="dbController">DbController used to communicate with the database.</param> /// <param name="id">ID of the MapSpawnValues to load.</param> /// <returns>The MapSpawnValues with ID <paramref name="id"/>.</returns> public static MapSpawnValues Load(IDbController dbController, MapSpawnValuesID id) { var values = dbController.GetQuery <SelectMapSpawnQuery>().Execute(id); Debug.Assert(id == values.ID); return(new MapSpawnValues(dbController, values)); }
/// <summary> /// Initializes a new instance of the <see cref="MapSpawnValues"/> class. /// </summary> /// <param name="dbController">The DbController used to synchronize changes to the values.</param> /// <param name="id">The unique ID of this MapSpawnValues.</param> /// <param name="mapID">The index of the Map that these values are for.</param> /// <param name="characterTemplateID">The CharacterTemplateID of the CharacterTemplate to spawn.</param> /// <param name="spawnAmount">The maximum number of Characters that will be spawned by this MapSpawnValues.</param> /// <param name="spawnRect">The area on the map the spawning will take place at.</param> MapSpawnValues(IDbController dbController, MapSpawnValuesID id, MapID mapID, CharacterTemplateID characterTemplateID, byte spawnAmount, MapSpawnRect spawnRect) { _dbController = dbController; _id = id; _mapID = mapID; _characterTemplateID = characterTemplateID; _spawnAmount = spawnAmount; _spawnArea = spawnRect; }
/// <summary> /// Initializes a new instance of the <see cref="MapSpawnTable"/> class. /// </summary> /// <param name="amount">The initial value for the corresponding property.</param> /// <param name="characterTemplateID">The initial value for the corresponding property.</param> /// <param name="height">The initial value for the corresponding property.</param> /// <param name="iD">The initial value for the corresponding property.</param> /// <param name="mapID">The initial value for the corresponding property.</param> /// <param name="width">The initial value for the corresponding property.</param> /// <param name="x">The initial value for the corresponding property.</param> /// <param name="y">The initial value for the corresponding property.</param> public MapSpawnTable(Byte @amount, CharacterTemplateID @characterTemplateID, ushort? @height, MapSpawnValuesID @iD, MapID @mapID, ushort? @width, ushort? @x, ushort? @y) { Amount = @amount; CharacterTemplateID = @characterTemplateID; Height = @height; ID = @iD; MapID = @mapID; Width = @width; X = @x; Y = @y; }
/// <summary> /// Initializes a new instance of the <see cref="MapSpawnValues"/> class. /// </summary> /// <param name="dbController">The DbController used to synchronize changes to the values.</param> /// <param name="id">The unique ID of this MapSpawnValues.</param> /// <param name="mapID">The index of the Map that these values are for.</param> /// <param name="characterTemplateID">The CharacterTemplateID of the CharacterTemplate to spawn.</param> /// <param name="spawnAmount">The maximum number of Characters that will be spawned by this MapSpawnValues.</param> /// <param name="spawnRect">The area on the map the spawning will take place at.</param> /// <param name="spawnDirection">The direction on this map to spawn the NPCs.</param> /// <param name="spawnRespawn">The time it takes for an NPC to spawn.</param> MapSpawnValues(IDbController dbController, MapSpawnValuesID id, MapID mapID, CharacterTemplateID characterTemplateID, byte spawnAmount, MapSpawnRect spawnRect, Direction spawnDirection, ushort spawnRespawn) { _dbController = dbController; _id = id; _mapID = mapID; _characterTemplateID = characterTemplateID; _spawnAmount = spawnAmount; _spawnArea = spawnRect; _spawnDirection = spawnDirection; _spawnRespawn = spawnRespawn; }
/// <summary> /// Loads a MapSpawnValues from the database. /// </summary> /// <param name="dbController">DbController used to communicate with the database.</param> /// <param name="id">ID of the MapSpawnValues to load.</param> /// <returns>The MapSpawnValues with ID <paramref name="id"/>.</returns> public static MapSpawnValues Load(IDbController dbController, MapSpawnValuesID id) { var values = dbController.GetQuery<SelectMapSpawnQuery>().Execute(id); Debug.Assert(id == values.ID); return new MapSpawnValues(dbController, values); }