MissionState
in package
Table of Contents
Properties
- $accountID : int
- $gameID : int
- $mission : Mission
- $missionID : int
- $CACHE : array<int, array<int, array<int, self>>>
- $complete : bool
- $expires : int
- $hasChanged : bool
- $onStep : int
- $unread : bool
Methods
- addPlayerMission() : self
- Add a new mission for the given player.
- checkAction() : void
- Check if an action satisfies the requirement for the current step, and if it does, advance to the next step.
- clearCache() : void
- delete() : void
- getPlayerMissionStates() : array<int, self>
- Get existing missions for the given player.
- getTask() : string
- getUnreadMessage() : string|null
- hasClaimableReward() : bool
- isComplete() : bool
- markComplete() : void
- markRead() : void
- saveMissionStates() : void
- __construct() : mixed
- advanceToNextStep() : void
- getFromRecord() : self
- getStep() : MissionStep
- isRequirementMet() : bool
- update() : bool
Properties
$accountID read-only
public
int
$accountID
$gameID read-only
public
int
$gameID
$mission read-only
public
Mission
$mission
$missionID read-only
public
int
$missionID
$CACHE
private
static array<int, array<int, array<int, self>>>
$CACHE
= []
$complete
private
bool
$complete
$expires read-only
private
int
$expires
$hasChanged
private
bool
$hasChanged
$onStep
private
int
$onStep
$unread
private
bool
$unread
Methods
addPlayerMission()
Add a new mission for the given player.
public
static addPlayerMission(AbstractPlayer $player, Mission $mission) : self
Parameters
- $player : AbstractPlayer
- $mission : Mission
Return values
selfcheckAction()
Check if an action satisfies the requirement for the current step, and if it does, advance to the next step.
public
checkAction(MissionAction $action) : void
Parameters
- $action : MissionAction
clearCache()
public
static clearCache() : void
delete()
public
delete() : void
getPlayerMissionStates()
Get existing missions for the given player.
public
static getPlayerMissionStates(AbstractPlayer $player) : array<int, self>
Parameters
- $player : AbstractPlayer
Return values
array<int, self>getTask()
public
getTask() : string
Return values
stringgetUnreadMessage()
public
getUnreadMessage() : string|null
Return values
string|nullhasClaimableReward()
public
hasClaimableReward(int $sectorID) : bool
Parameters
- $sectorID : int
Return values
boolisComplete()
public
isComplete() : bool
Return values
boolmarkComplete()
public
markComplete() : void
markRead()
public
markRead() : void
saveMissionStates()
public
static saveMissionStates() : void
__construct()
private
__construct(int $accountID, int $gameID, int $missionID, Mission $mission, int $onStep, bool $unread, int $expires, bool $complete, bool $hasChanged) : mixed
Parameters
- $accountID : int
- $gameID : int
- $missionID : int
- $mission : Mission
- $onStep : int
- $unread : bool
- $expires : int
- $complete : bool
- $hasChanged : bool
advanceToNextStep()
private
advanceToNextStep() : void
getFromRecord()
private
static getFromRecord(DatabaseRecord $record) : self
Parameters
- $record : DatabaseRecord
Return values
selfgetStep()
private
getStep() : MissionStep
Return values
MissionStepisRequirementMet()
private
isRequirementMet(MissionAction $action) : bool
Parameters
- $action : MissionAction
Return values
boolupdate()
private
update() : bool