SpaceRTS - Starter Pack  1.3
NullPointerGame.Extras.PlayerOwner Class Reference

Helper class to handle the existance of a Player owner for certain entity. Just is in charge of the dirty job ;) More...

Classes

interface  Events
 Events interface to handle all the player owner changes More...
 

Public Member Functions

 PlayerOwner (MonoBehaviour findAt, Events eventHandler)
 PlayerOwner constructor. Finds the Player through the findAt component. must have a Player sibling component or a PlayerControlled component. More...
 
void Init (MonoBehaviour findAt, Events eventHandler)
 Finds the Player through the findAt component. must have a Player sibling component or a PlayerControlled component. More...
 
void Clear ()
 Clears Player, PlayerControlled and event handler references More...
 

Static Public Member Functions

static bool HasValidOwner (PlayerOwner owner)
 Indicates if the PlayerOwner is valid and has a valid player owner. More...
 

Properties

Player Player [get]
 The current Player owner. More...
 

Detailed Description

Helper class to handle the existance of a Player owner for certain entity. Just is in charge of the dirty job ;)

Constructor & Destructor Documentation

◆ PlayerOwner()

NullPointerGame.Extras.PlayerOwner.PlayerOwner ( MonoBehaviour  findAt,
Events  eventHandler 
)

PlayerOwner constructor. Finds the Player through the findAt component. must have a Player sibling component or a PlayerControlled component.

Parameters
findAtStarting point to find the Player component.
eventHandlerThe object that will receive the owner changed events.

Member Function Documentation

◆ Clear()

void NullPointerGame.Extras.PlayerOwner.Clear ( )

Clears Player, PlayerControlled and event handler references

◆ HasValidOwner()

static bool NullPointerGame.Extras.PlayerOwner.HasValidOwner ( PlayerOwner  owner)
static

Indicates if the PlayerOwner is valid and has a valid player owner.

Parameters
ownerThe PlayerOwner class to test.
Returns
True in case owner is not null and owner.Player is not null; false in otherwise.

◆ Init()

void NullPointerGame.Extras.PlayerOwner.Init ( MonoBehaviour  findAt,
Events  eventHandler 
)

Finds the Player through the findAt component. must have a Player sibling component or a PlayerControlled component.

Parameters
findAtStarting point to find the Player component.
eventHandlerThe object that will receive the owner changed events.

Property Documentation

◆ Player

Player NullPointerGame.Extras.PlayerOwner.Player
get

The current Player owner.