C# Class Gruppe22.Backend.PureLogic

Program Logic completely abstracted from Frontend
Inheritance: Logic, IHandleEvent
Afficher le fichier Open project: propra13-orga/gruppe22 Class Usage Examples

Méthodes publiques

Méthode Description
ChangeMap ( string filename, Coords pos ) : void

Method to change the "room" Loads the saved (previously visited) version of the next room if possible and the generated version if there is no saved one

ConnectRecursive ( List rooms, int id, List visited = null ) : void
ConnectRooms ( List rooms = null, int From, Direction exit = Direction.None, int roomsPerRow ) : void
GenerateMaps ( ) : void

Generate three levels consisting of multiple rooms each and save them to xml files

GenericDialog ( int from, int to, string message = "" ) : void

A text displayed if the player died or talk to NPC

HandleEvent ( bool DownStream, Events eventID ) : void

Handle events from UIElements and/or backend objects

PureLogic ( IHandleEvent parent, Map map = null, Random _random = null ) : System

The constructor for the logic behind the game

ReassignPlayer ( ) : void
Restart ( ) : void

Method to for reseting the game to the generated version

Restore ( string name ) : void

Restore game progress from a saved state

Save ( string name ) : void

Save the game to a new folder

Update ( GameTime gametime ) : void

Method to start the update-routine of the map

Méthodes protégées

Méthode Description
_CombatDamage ( int attacker, int defender ) : void

Methode to evaluate the damage in a combat between two actors. Calculates the percentage damage reduction based on armor and penetration. Shows the floating combat text for the attack.

_TrapDamage ( Coords target ) : void

methode to evaluate the damage a trap deals to an actor walking over it or stands on raising trap

Private Methods

Méthode Description
FindAvailableExits ( List rooms = null, int id, int col, int totalCols, int row, int totalRows, int totalRooms, int roomsPerRow ) : Direction
_DeleteSavedRooms ( ) : void

Method to delete old saved rooms

Method Details

ChangeMap() public méthode

Method to change the "room" Loads the saved (previously visited) version of the next room if possible and the generated version if there is no saved one
public ChangeMap ( string filename, Coords pos ) : void
filename string The path to the .xml of the next room
pos Coords The spawning position in the next room
Résultat void

ConnectRecursive() public méthode

public ConnectRecursive ( List rooms, int id, List visited = null ) : void
rooms List
id int
visited List
Résultat void

ConnectRooms() public méthode

public ConnectRooms ( List rooms = null, int From, Direction exit = Direction.None, int roomsPerRow ) : void
rooms List
From int
exit Direction
roomsPerRow int
Résultat void

GenerateMaps() public méthode

Generate three levels consisting of multiple rooms each and save them to xml files
public GenerateMaps ( ) : void
Résultat void

GenericDialog() public méthode

A text displayed if the player died or talk to NPC
public GenericDialog ( int from, int to, string message = "" ) : void
from int
to int
message string A custom message that could be displayed
Résultat void

HandleEvent() public méthode

Handle events from UIElements and/or backend objects
public HandleEvent ( bool DownStream, Events eventID ) : void
DownStream bool
eventID Events The ID of the event
Résultat void

PureLogic() public méthode

The constructor for the logic behind the game
public PureLogic ( IHandleEvent parent, Map map = null, Random _random = null ) : System
parent IHandleEvent
map Map The map object which will contain the rooms
_random System.Random A random
Résultat System

ReassignPlayer() public méthode

public ReassignPlayer ( ) : void
Résultat void

Restart() public méthode

Method to for reseting the game to the generated version
public Restart ( ) : void
Résultat void

Restore() public méthode

Restore game progress from a saved state
public Restore ( string name ) : void
name string The directory where the gamestate is stored
Résultat void

Save() public méthode

Save the game to a new folder
public Save ( string name ) : void
name string The directory to which the game should be saved
Résultat void

Update() public méthode

Method to start the update-routine of the map
public Update ( GameTime gametime ) : void
gametime Microsoft.Xna.Framework.GameTime
Résultat void

_CombatDamage() protected méthode

Methode to evaluate the damage in a combat between two actors. Calculates the percentage damage reduction based on armor and penetration. Shows the floating combat text for the attack.
protected _CombatDamage ( int attacker, int defender ) : void
attacker int the attacking actor
defender int the attacked actor
Résultat void

_TrapDamage() protected méthode

methode to evaluate the damage a trap deals to an actor walking over it or stands on raising trap
protected _TrapDamage ( Coords target ) : void
target Coords Coords of the actor which walked over the trap
Résultat void