C# Класс Gruppe22.Backend.Item

Class to represent items ingame e.g. weapons, armor
Показать файл Открыть проект

Открытые методы

Метод Описание
ChangeEffect ( ItemEffect effect, bool enable ) : void

Method the activate the effects of an item for an owner

Drop ( FloorTile tile ) : void

Method to drop an item from an actor to the ground. Deletes the item from the inventory and creats an itemtile to place the item on the ground

EquipItem ( ) : void

Method to (un)equip an item disables and enables the effects of the item

EstimateValue ( ) : void

Method to evaluate the (gold)value of an item based of the type of the item and the number of effects.

GenerateIcon ( ) : void

Method to determine the icon for an item based on what kind of item it is

GenerateName ( ) : void

Method to generate a matching name for an item

GenerateProperties ( Random r = null ) : void

Method to create (random) effects for an item

Item ( ) : System

Konstruktor.

Item ( Actor owner, ItemType itemtype, string name = "", ImageData icon = null, int value, int level = 1 ) : System

Ein weiterer Konstruktor.

Item ( ItemTile parent, ItemType itemtype, string name = "", ImageData icon = null, int value, int level = 1 ) : System

Noch ein Konstruktor mit anderen Initial-Parametern.

Item ( ItemType itemtype, string name = "", Random r = null, ImageData icon = null, int value, int level = 1 ) : System

Another constructor for items

Item ( Random r = null, int value, int level = 1, bool gold = true ) : System

Constructor for an item.

Load ( XmlReader reader ) : void

Saving method. Parses the path to the item icon and all effects to xml

Pickup ( Actor actor ) : void

Method called when an actor picks up an item from the ground. Replaces the old owner and deletes the itemtile from the map

PropertyToString ( ItemProperty property ) : string

Method to convert the name of a property to a string

Save ( XmlWriter xmlw ) : void

Saving method

Update ( ) : void

The Update method for the itemeffect-duration

UseItem ( ) : void

Method called when a item is used.

Описание методов

ChangeEffect() публичный Метод

Method the activate the effects of an item for an owner
public ChangeEffect ( ItemEffect effect, bool enable ) : void
effect ItemEffect The effect which should be (de)activated
enable bool Whether the effect gets (de)activated
Результат void

Drop() публичный Метод

Method to drop an item from an actor to the ground. Deletes the item from the inventory and creats an itemtile to place the item on the ground
public Drop ( FloorTile tile ) : void
tile FloorTile The tile on which the itemtile with the item will be added.
Результат void

EquipItem() публичный Метод

Method to (un)equip an item disables and enables the effects of the item
public EquipItem ( ) : void
Результат void

EstimateValue() публичный Метод

Method to evaluate the (gold)value of an item based of the type of the item and the number of effects.
public EstimateValue ( ) : void
Результат void

GenerateIcon() публичный Метод

Method to determine the icon for an item based on what kind of item it is
public GenerateIcon ( ) : void
Результат void

GenerateName() публичный Метод

Method to generate a matching name for an item
public GenerateName ( ) : void
Результат void

GenerateProperties() публичный Метод

Method to create (random) effects for an item
public GenerateProperties ( Random r = null ) : void
r System.Random A dice used to create the effetcs
Результат void

Item() публичный Метод

Konstruktor.
public Item ( ) : System
Результат System

Item() публичный Метод

Ein weiterer Konstruktor.
public Item ( Actor owner, ItemType itemtype, string name = "", ImageData icon = null, int value, int level = 1 ) : System
owner Actor Der Besitzer-Actor des Items.
itemtype ItemType Typ
name string Name
icon ImageData Symbol
value int Wert
level int Level
Результат System

Item() публичный Метод

Noch ein Konstruktor mit anderen Initial-Parametern.
public Item ( ItemTile parent, ItemType itemtype, string name = "", ImageData icon = null, int value, int level = 1 ) : System
parent ItemTile
itemtype ItemType
name string
icon ImageData
value int
level int
Результат System

Item() публичный Метод

Another constructor for items
public Item ( ItemType itemtype, string name = "", Random r = null, ImageData icon = null, int value, int level = 1 ) : System
itemtype ItemType
name string
r System.Random
icon ImageData
value int
level int
Результат System

Item() публичный Метод

Constructor for an item.
public Item ( Random r = null, int value, int level = 1, bool gold = true ) : System
r System.Random by default null, gets generated in the constructor
value int by default 0
level int by default 1
gold bool True if the constructed item can be gold
Результат System

Load() публичный Метод

Saving method. Parses the path to the item icon and all effects to xml
public Load ( XmlReader reader ) : void
reader System.Xml.XmlReader XmlReader.
Результат void

Pickup() публичный Метод

Method called when an actor picks up an item from the ground. Replaces the old owner and deletes the itemtile from the map
public Pickup ( Actor actor ) : void
actor Actor The actor which gains the item
Результат void

PropertyToString() публичный статический Метод

Method to convert the name of a property to a string
public static PropertyToString ( ItemProperty property ) : string
property ItemProperty The effect which should be parsed to a string
Результат string

Save() публичный Метод

Saving method
public Save ( XmlWriter xmlw ) : void
xmlw System.Xml.XmlWriter XmlWriter.
Результат void

Update() публичный Метод

The Update method for the itemeffect-duration
public Update ( ) : void
Результат void

UseItem() публичный Метод

Method called when a item is used.
public UseItem ( ) : void
Результат void