C# Class PantheonPrototype.DialogueManager

This class will handle the basics of dialogue and what all that entails. This includes drawing the appropriate bubbles and text, as well as possibly handling some basic dialogue pathing and such.
Mostrar archivo Open project: Bacon41/PantheonPrototype Class Usage Examples

Protected Properties

Property Type Description
activeTextBubbles LinkedList
conversations ArrayList>.Dictionary
currentConversation System.Collections.ArrayList
currentConversationBubble TextBubble
currentConversationState int
interactionAlertEventHandler HandleEvent
interactionEventHandler HandleEvent
npcStateBubbles TextBubble>.Dictionary
npcStates string>.Dictionary
spontaneousConversationEventHandler HandleEvent
textFont Microsoft.Xna.Framework.Graphics.SpriteFont
textbubbleImage Microsoft.Xna.Framework.Graphics.Texture2D

Public Methods

Method Description
DialogueManager ( Pantheon gameReference, SpriteFont textFont ) : System

Constructs the basics of the DialogueManager class and prepares it to handle dialogue and conversation.

Draw ( SpriteBatch context ) : void

Draws all the active text bubbles in their appropriate place.

EndConversation ( string entityName ) : void

Ends all current conversations and resets the conversation handles and anchors.

Load ( Dictionary importedConversations ) : void

Loads the stuff.

StartConversation ( String entityName, Entity entity ) : bool

Starts a conversation with a given entity. This entity ID is used to identify which conversation to execute.

Unregister ( Pantheon gameREFERENCEOFDOOMFORTHESAVINGOFTHEUNIVERSE ) : void

Seems legit.

Update ( GameTime gameTime, Pantheon gameReference ) : void

Keeps DialogueManager up-to-date. Makes sure no conversations are still on going. Manages the checking of exit conditions for text bubbles.

Protected Methods

Method Description
interact ( Event firedEvent ) : void

Is used to interact with NPCs. If there is no conversation going, it will initialize one. If the end of a conversation has been reached, it will end the conversation.

interactAlert ( Event firedEvent ) : void

Handles an event for an interaction alert, such as a "close poximity" alert or a flagged NPC.

spontaneousConversation ( Event firedEvent ) : void

Adds the ability for spontaneous conversation, such as timed text boxes or temporary text boxes.

Method Details

DialogueManager() public method

Constructs the basics of the DialogueManager class and prepares it to handle dialogue and conversation.
public DialogueManager ( Pantheon gameReference, SpriteFont textFont ) : System
gameReference Pantheon
textFont Microsoft.Xna.Framework.Graphics.SpriteFont
return System

Draw() public method

Draws all the active text bubbles in their appropriate place.
public Draw ( SpriteBatch context ) : void
context Microsoft.Xna.Framework.Graphics.SpriteBatch
return void

EndConversation() public method

Ends all current conversations and resets the conversation handles and anchors.
public EndConversation ( string entityName ) : void
entityName string
return void

Load() public method

Loads the stuff.
public Load ( Dictionary importedConversations ) : void
importedConversations Dictionary
return void

StartConversation() public method

Starts a conversation with a given entity. This entity ID is used to identify which conversation to execute.
public StartConversation ( String entityName, Entity entity ) : bool
entityName String The entity to begin conversing with. Used as a handle to pick the conversation "column."
entity Entity
return bool

Unregister() public method

Seems legit.
public Unregister ( Pantheon gameREFERENCEOFDOOMFORTHESAVINGOFTHEUNIVERSE ) : void
gameREFERENCEOFDOOMFORTHESAVINGOFTHEUNIVERSE Pantheon yep
return void

Update() public method

Keeps DialogueManager up-to-date. Makes sure no conversations are still on going. Manages the checking of exit conditions for text bubbles.
public Update ( GameTime gameTime, Pantheon gameReference ) : void
gameTime Microsoft.Xna.Framework.GameTime
gameReference Pantheon
return void

interact() protected method

Is used to interact with NPCs. If there is no conversation going, it will initialize one. If the end of a conversation has been reached, it will end the conversation.
protected interact ( Event firedEvent ) : void
firedEvent Event The event of the fired thingy.
return void

interactAlert() protected method

Handles an event for an interaction alert, such as a "close poximity" alert or a flagged NPC.
protected interactAlert ( Event firedEvent ) : void
firedEvent Event The incoming event.
return void

spontaneousConversation() protected method

Adds the ability for spontaneous conversation, such as timed text boxes or temporary text boxes.
protected spontaneousConversation ( Event firedEvent ) : void
firedEvent Event The incoming event.
return void

Property Details

activeTextBubbles protected_oe property

protected LinkedList activeTextBubbles
return LinkedList

conversations protected_oe property

protected Dictionary conversations
return ArrayList>.Dictionary

currentConversation protected_oe property

protected ArrayList,System.Collections currentConversation
return System.Collections.ArrayList

currentConversationBubble protected_oe property

protected TextBubble,PantheonPrototype currentConversationBubble
return TextBubble

currentConversationState protected_oe property

protected int currentConversationState
return int

interactionAlertEventHandler protected_oe property

protected HandleEvent interactionAlertEventHandler
return HandleEvent

interactionEventHandler protected_oe property

protected HandleEvent interactionEventHandler
return HandleEvent

npcStateBubbles protected_oe property

protected Dictionary npcStateBubbles
return TextBubble>.Dictionary

npcStates protected_oe property

protected Dictionary npcStates
return string>.Dictionary

spontaneousConversationEventHandler protected_oe property

protected HandleEvent spontaneousConversationEventHandler
return HandleEvent

textFont protected_oe property

protected SpriteFont,Microsoft.Xna.Framework.Graphics textFont
return Microsoft.Xna.Framework.Graphics.SpriteFont

textbubbleImage protected_oe property

protected Texture2D,Microsoft.Xna.Framework.Graphics textbubbleImage
return Microsoft.Xna.Framework.Graphics.Texture2D