Class CardPile3D
Represents a pile of cards in 3D space.
Inherited Members
Namespace: PopcorningGuineaPig.Engine.UI
Assembly: PopcorningGuineaPig.Engine.dll
Syntax
public class CardPile3D
Constructors
| Edit this page View SourceCardPile3D(Vector3, Vector3, float)
Creates a new card pile.
Declaration
public CardPile3D(Vector3 position, Vector3 rotation, float cardSpacing = 0.01)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | position | The position of the pile |
| Vector3 | rotation | The rotation of the pile |
| float | cardSpacing | The spacing between cards in the pile |
Methods
| Edit this page View SourceAddCard(Card3D, bool)
Adds a card to the pile.
Declaration
public void AddCard(Card3D card, bool animate = true)
Parameters
| Type | Name | Description |
|---|---|---|
| Card3D | card | The card to add |
| bool | animate | Whether to animate the card moving to the pile |
Draw(Camera3D)
Draws the pile.
Declaration
public void Draw(Camera3D camera)
Parameters
| Type | Name | Description |
|---|---|---|
| Camera3D | camera | The camera to use for rendering |
DrawCard(bool)
Draws a card from the top of the pile.
Declaration
public Card3D? DrawCard(bool animate = true)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | animate | Whether to animate the card being drawn |
Returns
| Type | Description |
|---|---|
| Card3D | The card that was drawn, or null if the pile is empty |
GetCardCount()
Gets the number of cards in the pile.
Declaration
public int GetCardCount()
Returns
| Type | Description |
|---|---|
| int | The number of cards |
GetPosition()
Gets the position of the pile.
Declaration
public Vector3 GetPosition()
Returns
| Type | Description |
|---|---|
| Vector3 | The position |
IsPointOver(Vector2, Camera3D)
Checks if a point in screen space is over the pile.
Declaration
public bool IsPointOver(Vector2 screenPoint, Camera3D camera)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | screenPoint | The point in screen space |
| Camera3D | camera | The camera used for rendering |
Returns
| Type | Description |
|---|---|
| bool | True if the point is over the pile, false otherwise |
Shuffle()
Shuffles the cards in the pile.
Declaration
public void Shuffle()
Unload()
Unloads the card models in the pile.
Declaration
public void Unload()
Update(float)
Updates the pile.
Declaration
public void Update(float deltaTime)
Parameters
| Type | Name | Description |
|---|---|---|
| float | deltaTime | The time elapsed since the last update |