C# 클래스 Descent.GUI.GUIElementFactory

Responsible for creating the GUIElements for the different layers of the gui and for all the different states and roles in the game. This is done as a simple hierarchy of GUIElements and should be populated with logic (events on click) and Drawables to be displayed within the respective GUIElements in the tree.
파일 보기 프로젝트 열기: nezbo/Descent

공개 메소드들

메소드 설명
CreateBoardElement ( Microsoft.Xna.Framework.Game game, Board board, Role role ) : GUIElement

Creates a guielement that displays how the board looks like and keeps updated when the board changes.

CreateEquipmentElement ( Microsoft.Xna.Framework.Game game, int x, int y, string slotTitle, Equipment equipment, int id ) : EquipmentElement

Creates an EquipmentElement for visualization of the properties of the given equipment. Using this method to create the element makes sure that all EquipmentElements in the game has the same dimensions and are equipped with proper click events.

CreateMenuElement ( Microsoft.Xna.Framework.Game game, Role role ) : GUIElement
CreateStateElement ( Microsoft.Xna.Framework.Game game, State state, Role role, GameState gameState ) : GUIElement

Creates a GUIElement that fits the given parameters.

DrawDice ( GUIElement target, EDice dice, int x, int y, int size ) : void

Draws a given dice-type to the target GUIElement. By using this method to draw the EDice, you're sure it's drawn the same way every time.

DrawSurgeAbility ( GUIElement target, SurgeAbility ability, int xPosition, int yPosition, bool small ) : void

Draws a visualization of a SurgeAbility on a target GUIElement. By using this method to draw the SurgeAbility, you're sure it's drawn the same way every time.

비공개 메소드들

메소드 설명
CreateEmptyRoot ( Microsoft.Xna.Framework.Game game ) : GUIElement
LoadDiceTextures ( Microsoft.Xna.Framework.Game game ) : void
RelH ( Viewport viewport, int percentage ) : int
RelW ( Viewport viewport, int percentage ) : int

메소드 상세

CreateBoardElement() 공개 정적인 메소드

Creates a guielement that displays how the board looks like and keeps updated when the board changes.
public static CreateBoardElement ( Microsoft.Xna.Framework.Game game, Board board, Role role ) : GUIElement
game Microsoft.Xna.Framework.Game The current Game object.
board Descent.Model.Board.Board The Board to visualize.
role Role The Role to view the board from, for example /// the overlord may see the entire board from the beginning
리턴 GUIElement

CreateEquipmentElement() 공개 정적인 메소드

Creates an EquipmentElement for visualization of the properties of the given equipment. Using this method to create the element makes sure that all EquipmentElements in the game has the same dimensions and are equipped with proper click events.
public static CreateEquipmentElement ( Microsoft.Xna.Framework.Game game, int x, int y, string slotTitle, Equipment equipment, int id ) : EquipmentElement
game Microsoft.Xna.Framework.Game The current Game object.
x int Will be the top-left coordinate of the EquipmentElement.
y int Will be the top-left coordinate of the EquipmentElement.
slotTitle string In case that the equipment is null it will display this title for the missing equipment.
equipment Descent.Model.Player.Figure.HeroStuff.Equipment The Equipment to visualize. Null here will indicate that the equipment slot is empty.
id int The game logic ID of this equipment, will be used for the click event.
리턴 Descent.GUI.SubElements.EquipmentElement

CreateMenuElement() 공개 정적인 메소드

public static CreateMenuElement ( Microsoft.Xna.Framework.Game game, Role role ) : GUIElement
game Microsoft.Xna.Framework.Game
role Role
리턴 GUIElement

CreateStateElement() 공개 정적인 메소드

Creates a GUIElement that fits the given parameters.
public static CreateStateElement ( Microsoft.Xna.Framework.Game game, State state, Role role, GameState gameState ) : GUIElement
game Microsoft.Xna.Framework.Game The current Game object.
state State The State to be visualized.
role Role The Role to view the given state from.
gameState Descent.State.GameState An object that holds some game properties that is needed for some States.
리턴 GUIElement

DrawDice() 공개 정적인 메소드

Draws a given dice-type to the target GUIElement. By using this method to draw the EDice, you're sure it's drawn the same way every time.
public static DrawDice ( GUIElement target, EDice dice, int x, int y, int size ) : void
target GUIElement The GUIElement to display the dice in.
dice EDice The dice to display.
x int The top-left x-coordinate to start drawing from.
y int The top-left y-coordinate to start drawing from.
size int The width and height in pixels.
리턴 void

DrawSurgeAbility() 공개 정적인 메소드

Draws a visualization of a SurgeAbility on a target GUIElement. By using this method to draw the SurgeAbility, you're sure it's drawn the same way every time.
public static DrawSurgeAbility ( GUIElement target, SurgeAbility ability, int xPosition, int yPosition, bool small ) : void
target GUIElement The GUIElement to draw the SurgeAbility on.
ability Descent.Model.Player.Figure.HeroStuff.SurgeAbility The SurgeAbility to display.
xPosition int The top-left x-coordinate to start drawing from.
yPosition int The top-left y-coordinate to start drawing from.
small bool True if the surge ability should be drawn as compact as possible, else false.
리턴 void