mirror of
https://github.com/furyfire/trueskill.git
synced 2025-04-16 19:14:27 +00:00
Pint applied for formatting
This commit is contained in:
@ -1,17 +1,21 @@
|
||||
<?php namespace DNW\Skills;
|
||||
<?php
|
||||
|
||||
namespace DNW\Skills;
|
||||
|
||||
/**
|
||||
* Basic hashmap that supports object keys.
|
||||
*/
|
||||
class HashMap
|
||||
{
|
||||
private $_hashToValue = array();
|
||||
private $_hashToKey = array();
|
||||
private $_hashToValue = [];
|
||||
|
||||
private $_hashToKey = [];
|
||||
|
||||
public function getValue($key)
|
||||
{
|
||||
$hash = self::getHash($key);
|
||||
$hashValue = $this->_hashToValue[$hash];
|
||||
|
||||
return $hashValue;
|
||||
}
|
||||
|
||||
@ -20,18 +24,21 @@ class HashMap
|
||||
$hash = self::getHash($key);
|
||||
$this->_hashToKey[$hash] = $key;
|
||||
$this->_hashToValue[$hash] = $value;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getAllKeys()
|
||||
{
|
||||
$keys = array_values($this->_hashToKey);
|
||||
|
||||
return $keys;
|
||||
}
|
||||
|
||||
public function getAllValues()
|
||||
{
|
||||
$values = array_values($this->_hashToValue);
|
||||
|
||||
return $values;
|
||||
}
|
||||
|
||||
@ -48,4 +55,4 @@ class HashMap
|
||||
|
||||
return $key;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user