C# 클래스 Gruppe22.Backend.Generator

상속: Map
파일 보기 프로젝트 열기: propra13-orga/gruppe22

공개 메소드들

메소드 설명
AddBoss ( ) : void

Method to add a boss enemy to a room. A boss is more powerful than a normal enemy and the room gets a special sound if there is a boss in it.

AddCheckpoint ( ) : void

Method to add the CheckpointTiles to a room.

AddDoors ( int roomID = 1, int maxRoom = 3, List doors = null ) : void

Method to add a door to the next level to a room.

AddEnemies ( int amount = -1 ) : void

Method to generate the enemys for a room. The method places enemys at free position and initializes them.

AddItems ( int amount = -1 ) : void

Method to place some random items in a room.

AddNPC ( int amount = -1 ) : void

Method to add NPCs in a room. By default the NPCs have some money and a dialogue.

AddPlayer ( Coords pos ) : void

Method to add the player to a room.

AddShop ( ) : void

Method to add a shop to the map. The method adds a NPC with a shop and some custom tiles around him.

AddStairs ( Coords srcCoords, int targetRoom, Backend targetCoords, bool up ) : void

Method to add the stairs to the next level to a room.

AddTarget ( Coords srcCoords ) : void

Method to add the TargetTile to a room (usually a room in the highest level). The Target is surrounded by walls and a door.

AddTraps ( int amount = -1 ) : void

Method to add some TrapTiles to a room.

CleanupRoom ( ) : void
ClearMaze ( ) : void

Create a grid of walls

ClearTile ( int x, int y ) : void

Remove all elements from a tile

ClearWalls ( int amount = -1 ) : void

Remove walls at random for more space

ConnectTo ( Coords from, int Room, Backend to, bool isTeleport = false ) : void

Add a doorway / stairway / teleporter to another room

DrawWalls ( ) : void

Method to add the outer walls to a room.

FromString ( string input, int roomID, int MaxRoom ) : bool

Method to generate a room from a string (e.g. a .txt)

GenerateDungeon ( ) : void

Method to choose a name for the dungeon.

GenerateMaze ( ) : void

Create a new maze

GenerateRoomName ( ) : void

Method to choose a name for a room.

Generator ( object parent = null, int width = 10, int height = 10, bool generate = false, Backend playerPos = null, int roomNr = 1, int maxRoom = 3, Random rnd = null, string dungeonname = "", int level, bool hasShop = false, bool hasNPC = false, bool hasBoss = false ) : System

Create an empty map

Generator ( object parent, string pattern, int roomNr = 1, int maxRoom = 3, List exits = null, Random rnd = null ) : System

The constructor for the Generator.

HasExit ( Direction dir ) : bool

Method to check whether there is a connection to another room.

Save ( string filename, string subdir = "save\\auto\\" ) : void

Write the current map to a file

SuggestExit ( Direction dir ) : Backend.Coords

Find an appropriate place to put an exit on the map

비공개 메소드들

메소드 설명
_NextTile ( Path &pos ) : void
_Walk ( Path current ) : Path

Get the next tile based on included Connection info

메소드 상세

AddBoss() 공개 메소드

Method to add a boss enemy to a room. A boss is more powerful than a normal enemy and the room gets a special sound if there is a boss in it.
public AddBoss ( ) : void
리턴 void

AddCheckpoint() 공개 메소드

Method to add the CheckpointTiles to a room.
public AddCheckpoint ( ) : void
리턴 void

AddDoors() 공개 메소드

Method to add a door to the next level to a room.
public AddDoors ( int roomID = 1, int maxRoom = 3, List doors = null ) : void
roomID int
maxRoom int
doors List
리턴 void

AddEnemies() 공개 메소드

Method to generate the enemys for a room. The method places enemys at free position and initializes them.
public AddEnemies ( int amount = -1 ) : void
amount int The number of enemys for a room, 5 by default
리턴 void

AddItems() 공개 메소드

Method to place some random items in a room.
public AddItems ( int amount = -1 ) : void
amount int 5 by default.
리턴 void

AddNPC() 공개 메소드

Method to add NPCs in a room. By default the NPCs have some money and a dialogue.
public AddNPC ( int amount = -1 ) : void
amount int 1 by default
리턴 void

AddPlayer() 공개 메소드

Method to add the player to a room.
public AddPlayer ( Coords pos ) : void
pos Coords The position at which the player will spawn, (1,1) by default
리턴 void

AddShop() 공개 메소드

Method to add a shop to the map. The method adds a NPC with a shop and some custom tiles around him.
public AddShop ( ) : void
리턴 void

AddStairs() 공개 메소드

Method to add the stairs to the next level to a room.
public AddStairs ( Coords srcCoords, int targetRoom, Backend targetCoords, bool up ) : void
srcCoords Coords The place where the stairs will get placed
targetRoom int The number of the room the stairs lead to
targetCoords Backend The coords of the stairs in the next room
up bool Upstairs or Downstairs
리턴 void

AddTarget() 공개 메소드

Method to add the TargetTile to a room (usually a room in the highest level). The Target is surrounded by walls and a door.
public AddTarget ( Coords srcCoords ) : void
srcCoords Coords The coordinates for the TargetTile
리턴 void

AddTraps() 공개 메소드

Method to add some TrapTiles to a room.
public AddTraps ( int amount = -1 ) : void
amount int 5 by default.
리턴 void

CleanupRoom() 공개 메소드

public CleanupRoom ( ) : void
리턴 void

ClearMaze() 공개 메소드

Create a grid of walls
public ClearMaze ( ) : void
리턴 void

ClearTile() 공개 메소드

Remove all elements from a tile
public ClearTile ( int x, int y ) : void
x int
y int
리턴 void

ClearWalls() 공개 메소드

Remove walls at random for more space
public ClearWalls ( int amount = -1 ) : void
amount int Amount of walls to remove
리턴 void

ConnectTo() 공개 메소드

Add a doorway / stairway / teleporter to another room
public ConnectTo ( Coords from, int Room, Backend to, bool isTeleport = false ) : void
from Coords Coordinates in this room
Room int Uinque ID of target room
to Backend Coordinates in target room
isTeleport bool
리턴 void

DrawWalls() 공개 메소드

Method to add the outer walls to a room.
public DrawWalls ( ) : void
리턴 void

FromString() 공개 메소드

Method to generate a room from a string (e.g. a .txt)
public FromString ( string input, int roomID, int MaxRoom ) : bool
input string The string from which the room will be constructed
roomID int The number of the room.
MaxRoom int The max number of rooms
리턴 bool

GenerateDungeon() 공개 메소드

Method to choose a name for the dungeon.
public GenerateDungeon ( ) : void
리턴 void

GenerateMaze() 공개 메소드

Create a new maze
public GenerateMaze ( ) : void
리턴 void

GenerateRoomName() 공개 메소드

Method to choose a name for a room.
public GenerateRoomName ( ) : void
리턴 void

Generator() 공개 메소드

Create an empty map
public Generator ( object parent = null, int width = 10, int height = 10, bool generate = false, Backend playerPos = null, int roomNr = 1, int maxRoom = 3, Random rnd = null, string dungeonname = "", int level, bool hasShop = false, bool hasNPC = false, bool hasBoss = false ) : System
parent object
width int The width of the map
height int The height of the map
generate bool
playerPos Backend
roomNr int
maxRoom int
rnd System.Random
dungeonname string
level int
hasShop bool
hasNPC bool
hasBoss bool
리턴 System

Generator() 공개 메소드

The constructor for the Generator.
public Generator ( object parent, string pattern, int roomNr = 1, int maxRoom = 3, List exits = null, Random rnd = null ) : System
parent object
pattern string
roomNr int
maxRoom int
exits List
rnd System.Random
리턴 System

HasExit() 공개 메소드

Method to check whether there is a connection to another room.
public HasExit ( Direction dir ) : bool
dir Direction
리턴 bool

Save() 공개 메소드

Write the current map to a file
public Save ( string filename, string subdir = "save\\auto\\" ) : void
filename string The filename to write to
subdir string
리턴 void

SuggestExit() 공개 메소드

Find an appropriate place to put an exit on the map
public SuggestExit ( Direction dir ) : Backend.Coords
dir Direction Wall on which exit should be placed
리턴 Backend.Coords