GenisysPro  for Minecraft PE/Windows 10 v1.1.x
Feature-rich server software for Minecraft PE and Windows 10 Edition
SimpleTransactionQueue Class Reference

Public Member Functions

 __construct (Player $player=null)
 
 getPlayer ()
 
 getInventories ()
 
 getTransactions ()
 
 getTransactionCount ()
 
 addTransaction (Transaction $transaction)
 
- Public Member Functions inherited from TransactionQueue
 execute ()
 

Protected Attributes

 $player = null
 
 $transactionQueue
 
 $transactionsToRetry
 
 $inventories
 
 $lastUpdate = -1
 
 $transactionCount = 0
 

Additional Inherited Members

- Data Fields inherited from TransactionQueue
const DEFAULT_ALLOWED_RETRIES = 5
 

Constructor & Destructor Documentation

◆ __construct()

__construct ( Player  $player = null)
Parameters
Player$player
49  {
50  $this->player = $player;
51  $this->transactionQueue = new \SplQueue();
52  $this->transactionsToRetry = new \SplQueue();
53  }

Member Function Documentation

◆ addTransaction()

addTransaction ( Transaction  $transaction)
Parameters
Transaction$transaction

For dropping items, the target inventory is open air, a.k.a. null.

Implements TransactionQueue.

86  {
87  $this->transactionQueue->enqueue($transaction);
88  if($transaction->getInventory() instanceof Inventory){
90  $this->inventories[spl_object_hash($transaction)] = $transaction->getInventory();
91  }
92  $this->lastUpdate = microtime(true);
93  $this->transactionCount += 1;
94  }

◆ getInventories()

getInventories ( )
Returns
Inventory[]

Implements TransactionQueue.

65  {
66  return $this->inventories;
67  }

◆ getPlayer()

getPlayer ( )
Returns
Player
58  {
59  return $this->player;
60  }

◆ getTransactionCount()

getTransactionCount ( )
Returns
int

Implements TransactionQueue.

79  {
81  }

◆ getTransactions()

getTransactions ( )
Returns

Implements TransactionQueue.

72  {
74  }

Field Documentation

◆ $inventories

$inventories
protected

◆ $lastUpdate

$lastUpdate = -1
protected

◆ $player

$player = null
protected

◆ $transactionCount

$transactionCount = 0
protected

◆ $transactionQueue

$transactionQueue
protected

◆ $transactionsToRetry

$transactionsToRetry
protected

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