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

Public Member Functions

 __construct ($text, array $params=[])
 
 getParameters ()
 
 getParameter ($i)
 
 setParameter ($i, $str)
 
 setParameters (array $params)
 
- Public Member Functions inherited from TextContainer
 __construct ($text)
 
 setText ($text)
 
 getText ()
 
 __toString ()
 

Protected Attributes

 $params = []
 
- Protected Attributes inherited from TextContainer
 $text
 

Constructor & Destructor Documentation

◆ __construct()

__construct (   $text,
array  $params = [] 
)
Parameters
string$text
string[]$params
33  {
34  parent::__construct($text);
35 
36  $this->setParameters($params);
37  }

Member Function Documentation

◆ getParameter()

getParameter (   $i)
Parameters
int$i
Returns
string
51  {
52  return isset($this->params[$i]) ? $this->params[$i] : null;
53  }

◆ getParameters()

getParameters ( )
Returns
string[]
42  {
43  return $this->params;
44  }

◆ setParameter()

setParameter (   $i,
  $str 
)
Parameters
int$i
string$str
59  {
60  if($i < 0 or $i > count($this->params)){ //Intended, allow to set the last
61  throw new \InvalidArgumentException("Invalid index $i, have " . count($this->params));
62  }
63 
64  $this->params[(int) $i] = $str;
65  }

◆ setParameters()

setParameters ( array  $params)
Parameters
string[]$params
70  {
71  $i = 0;
72  foreach($params as $str){
73  $this->params[$i] = (string) $str;
74 
75  ++$i;
76  }
77  }

Field Documentation

◆ $params

$params = []
protected

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