mirror of
https://github.com/JeroenED/libpairtwo.git
synced 2024-11-22 06:26:57 +01:00
Merge branch 'task/getids-getelos' into develop
This commit is contained in:
commit
a2842a24d2
@ -68,7 +68,7 @@ abstract class Player
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return int[]
|
* @return string[]
|
||||||
*/
|
*/
|
||||||
public function getIds(): array
|
public function getIds(): array
|
||||||
{
|
{
|
||||||
@ -76,7 +76,7 @@ abstract class Player
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param int[] $Ids
|
* @param string[] $Ids
|
||||||
* @return Player
|
* @return Player
|
||||||
*/
|
*/
|
||||||
public function setIds(array $Ids): Player
|
public function setIds(array $Ids): Player
|
||||||
|
@ -52,4 +52,48 @@ class Player extends PlayerModel
|
|||||||
|
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $type
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public function getElo(string $type): int
|
||||||
|
{
|
||||||
|
return $this->getElos()[$type];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $type
|
||||||
|
* @param int $value
|
||||||
|
* @return Player
|
||||||
|
*/
|
||||||
|
public function setElo(string $type, int $value): Player
|
||||||
|
{
|
||||||
|
$currentElos = $this->getElos();
|
||||||
|
$currentElos[$type] = $value;
|
||||||
|
$this->setElos($currentElos);
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $type
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getId(string $type): string
|
||||||
|
{
|
||||||
|
return $this->getElos()[$type];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $type
|
||||||
|
* @param string $value
|
||||||
|
* @return Player
|
||||||
|
*/
|
||||||
|
public function setId(string $type, string $value): Player
|
||||||
|
{
|
||||||
|
$currentIds = $this->getIds();
|
||||||
|
$currentIds[$type] = $value;
|
||||||
|
$this->setIds($currentIds);
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -306,7 +306,7 @@ class Pairtwo6 extends Pairtwo6Model implements ReaderInterface
|
|||||||
$offset += $length;
|
$offset += $length;
|
||||||
|
|
||||||
$length = 4;
|
$length = 4;
|
||||||
$ids['world'] = $this->readData('Int', substr($swscontents, $offset, $length));
|
$player->setId('world', $this->readData('Int', substr($swscontents, $offset, $length) . ""));
|
||||||
$offset += $length;
|
$offset += $length;
|
||||||
|
|
||||||
$length = 4;
|
$length = 4;
|
||||||
@ -314,7 +314,7 @@ class Pairtwo6 extends Pairtwo6Model implements ReaderInterface
|
|||||||
$offset += $length;
|
$offset += $length;
|
||||||
|
|
||||||
$length = 4;
|
$length = 4;
|
||||||
$elos['home'] = $this->readData('Int', substr($swscontents, $offset, $length));
|
$player->setElo('home', $this->readData('Int', substr($swscontents, $offset, $length)));
|
||||||
$offset += $length;
|
$offset += $length;
|
||||||
|
|
||||||
$length = 4;
|
$length = 4;
|
||||||
@ -322,7 +322,7 @@ class Pairtwo6 extends Pairtwo6Model implements ReaderInterface
|
|||||||
$offset += $length;
|
$offset += $length;
|
||||||
|
|
||||||
$length = 4;
|
$length = 4;
|
||||||
$ids['home'] = $this->readData('Int', substr($swscontents, $offset, $length));
|
$player->setId('home', $this->readData('Int', substr($swscontents, $offset, $length)));
|
||||||
$offset += $length;
|
$offset += $length;
|
||||||
|
|
||||||
$length = 4;
|
$length = 4;
|
||||||
@ -330,7 +330,7 @@ class Pairtwo6 extends Pairtwo6Model implements ReaderInterface
|
|||||||
$offset += $length;
|
$offset += $length;
|
||||||
|
|
||||||
$length = 4;
|
$length = 4;
|
||||||
$ids['club'] = $this->readData('Int', substr($swscontents, $offset, $length));
|
$player->setId('club', $this->readData('Int', substr($swscontents, $offset, $length)));
|
||||||
$offset += $length;
|
$offset += $length;
|
||||||
|
|
||||||
$length = 4;
|
$length = 4;
|
||||||
@ -346,7 +346,7 @@ class Pairtwo6 extends Pairtwo6Model implements ReaderInterface
|
|||||||
$offset += $length;
|
$offset += $length;
|
||||||
|
|
||||||
$length = 4;
|
$length = 4;
|
||||||
$elos['world'] = $this->readData('Int', substr($swscontents, $offset, $length));
|
$player->setElo('world', $this->readData('Int', substr($swscontents, $offset, $length)));
|
||||||
$offset += $length;
|
$offset += $length;
|
||||||
|
|
||||||
$length = 1;
|
$length = 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user