mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 19:49:44 +00:00
project uses tabs instead of spaces(as in CONTRIBUTING.md)
This commit is contained in:
parent
f00318b6ed
commit
62571f26cd
115 changed files with 2291 additions and 2364 deletions
|
|
@ -1,40 +1,40 @@
|
|||
<?php
|
||||
|
||||
class ArrayList{
|
||||
public $arr = [];
|
||||
public function add(IElement $e){
|
||||
$this->arr[$e->__toString()] = $e;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function addAll($es){
|
||||
foreach($es as $e){
|
||||
$this->add($this->add($e));
|
||||
}
|
||||
}
|
||||
|
||||
public function getFirst(){
|
||||
return array_values($this->arr)[0];
|
||||
}
|
||||
|
||||
public function remove(IElement $e){
|
||||
unset($this->arr[$e->__toString()]);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function __isset($e){
|
||||
return isset($this->arr[$e->__toString()]);
|
||||
}
|
||||
|
||||
public function has(IElement $e){
|
||||
return isset($this->arr[$e->__toString()]);
|
||||
}
|
||||
|
||||
public function sortWith($func){
|
||||
return uasort($this->arr, $func);
|
||||
}
|
||||
|
||||
public function countElements(){
|
||||
return count($this->arr);
|
||||
}
|
||||
public $arr = [];
|
||||
public function add(IElement $e){
|
||||
$this->arr[$e->__toString()] = $e;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function addAll($es){
|
||||
foreach($es as $e){
|
||||
$this->add($this->add($e));
|
||||
}
|
||||
}
|
||||
|
||||
public function getFirst(){
|
||||
return array_values($this->arr)[0];
|
||||
}
|
||||
|
||||
public function remove(IElement $e){
|
||||
unset($this->arr[$e->__toString()]);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function __isset($e){
|
||||
return isset($this->arr[$e->__toString()]);
|
||||
}
|
||||
|
||||
public function has(IElement $e){
|
||||
return isset($this->arr[$e->__toString()]);
|
||||
}
|
||||
|
||||
public function sortWith($func){
|
||||
return uasort($this->arr, $func);
|
||||
}
|
||||
|
||||
public function countElements(){
|
||||
return count($this->arr);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue