|
RpgGame
Console Based RPG game in C#
|
Provides common item-spawning routines that can be shared among multiple IMapGenerator implementations. More...
Static Public Member Functions | |
| static Task | SpawnItemsAsync< TItem > (Level level, int count, Func< TItem > factory) |
| Asynchronously places a number of items at random walkable locations on the given level. | |
| static Task | SpawnCoinsAsync (Level level, int count) |
| Convenience wrapper that spawns coins. | |
| static Task | SpawnSwordAsync (Level level, int count) |
| Convenience wrapper that spawns one-handed swords. | |
| static Task | SpawnDoubleSwordAsync (Level level, int count) |
| Convenience wrapper that spawns two-handed swords. | |
| static Task | SpawnGoldAsync (Level level, int count) |
| Convenience wrapper that spawns gold piles. | |
| static Task | SpawnPotionsAsync (Level level, int count) |
| Convenience wrapper that spawns potions. | |
| static Task | SpawnThornsAsync (Level level, int count) |
| Conveniece wrapper that spawns Thorns. | |
Provides common item-spawning routines that can be shared among multiple IMapGenerator implementations.
The helpers choose random walkable positions on the map and place the requested items there. By centralizing the logic here, generators don't have to duplicate the same loops and checks over and over.
|
static |
Convenience wrapper that spawns coins.
| level | |
| count |
|
static |
Convenience wrapper that spawns two-handed swords.
| level | |
| count |
|
static |
Convenience wrapper that spawns gold piles.
| level | |
| count |
|
inlinestatic |
Asynchronously places a number of items at random walkable locations on the given level.
| TItem | The concrete Item type. |
| level | Level instance to populate. |
| count | Total number of items to spawn. |
| factory | Function that returns a fresh item instance. |
The placement logic executes on the thread pool because the work is CPU-bound; callers can await the returned task without blocking the caller thread.
| TItem | : | IItem |
|
static |
Convenience wrapper that spawns potions.
| level | |
| count |
|
static |
Convenience wrapper that spawns one-handed swords.
| level | |
| count |
|
static |
Conveniece wrapper that spawns Thorns.
| level | |
| count |