XposeCraft  1.0.1-rc1
Developer API
XposeCraft.GameInternal.Player Class Reference

Data structures that make up the Model of a Player used within a game. More...

Inheritance diagram for XposeCraft.GameInternal.Player:

Classes

class  EventList
 
class  RegisteredEventsDictionary
 

Public Types

enum  LoseReason { LoseReason.ExceptionThrown, LoseReason.AllBuildingsDestroyed, LoseReason.TimeoutStalemate }
 Reason of losing. More...
 

Public Member Functions

void EnemyOnSight (GameObject enemyActorGameObject, Actor enemyActor, List< GameObject > myActorGameObjectsSaw, List< Actor > myActorsSaw, VisionState previousState, VisionState newState)
 
void Win ()
 
void Lost (LoseReason loseReason)
 
void Lost (Exception exception)
 

Public Attributes

Faction Faction
 Faction of the Player, allied Players will share it. More...
 
int FactionIndex
 
PlaceType MyBase
 This Player's Base. More...
 
PlaceType EnemyBase
 This Player's Enemy's Base. More...
 
RegisteredEventsDictionary RegisteredEvents
 Actions hooked to Events that can, but don't have to be, run at any time. More...
 
List< UnitUnits
 
List< BuildingBuildings
 
List< ResourceResources
 
List< UnitEnemyVisibleUnits
 
List< BuildingEnemyVisibleBuildings
 

Static Public Attributes

static Player CurrentPlayer
 Curently executing Player to be used as a Model. More...
 

Properties

bool LostGame [get, set]
 True if already lost. More...
 
bool ExceptionOnDeadUnitAction [get, set]
 

Detailed Description

Data structures that make up the Model of a Player used within a game.

It is a good idea not to persist it as a prefab, as the instance will usually hold references to Scene objects.

Member Enumeration Documentation

◆ LoseReason

Reason of losing.

Enumerator
ExceptionThrown 
AllBuildingsDestroyed 
TimeoutStalemate 

Member Function Documentation

◆ EnemyOnSight()

void XposeCraft.GameInternal.Player.EnemyOnSight ( GameObject  enemyActorGameObject,
Actor  enemyActor,
List< GameObject >  myActorGameObjectsSaw,
List< Actor myActorsSaw,
VisionState  previousState,
VisionState  newState 
)

◆ Lost() [1/2]

void XposeCraft.GameInternal.Player.Lost ( LoseReason  loseReason)

◆ Lost() [2/2]

void XposeCraft.GameInternal.Player.Lost ( Exception  exception)

◆ Win()

void XposeCraft.GameInternal.Player.Win ( )

Member Data Documentation

◆ Buildings

List<Building> XposeCraft.GameInternal.Player.Buildings

◆ CurrentPlayer

Player XposeCraft.GameInternal.Player.CurrentPlayer
static

Curently executing Player to be used as a Model.

Needs to be replaced before executing any Event.

◆ EnemyBase

PlaceType XposeCraft.GameInternal.Player.EnemyBase

This Player's Enemy's Base.

◆ EnemyVisibleBuildings

List<Building> XposeCraft.GameInternal.Player.EnemyVisibleBuildings

◆ EnemyVisibleUnits

List<Unit> XposeCraft.GameInternal.Player.EnemyVisibleUnits

◆ Faction

Faction XposeCraft.GameInternal.Player.Faction

Faction of the Player, allied Players will share it.

◆ FactionIndex

int XposeCraft.GameInternal.Player.FactionIndex

◆ MyBase

PlaceType XposeCraft.GameInternal.Player.MyBase

This Player's Base.

◆ RegisteredEvents

RegisteredEventsDictionary XposeCraft.GameInternal.Player.RegisteredEvents

Actions hooked to Events that can, but don't have to be, run at any time.

◆ Resources

List<Resource> XposeCraft.GameInternal.Player.Resources

◆ Units

List<Unit> XposeCraft.GameInternal.Player.Units

Property Documentation

◆ ExceptionOnDeadUnitAction

bool XposeCraft.GameInternal.Player.ExceptionOnDeadUnitAction
getset

◆ LostGame

bool XposeCraft.GameInternal.Player.LostGame
getset

True if already lost.


The documentation for this class was generated from the following file: