public function getObjects($state = null)
    {
        if (!isset($state)) {
            return $this->objects;
        }

        $objectList = [];
        foreach ($this->objects as $id => $object) {
            if ($this->objectStates[$id] == $state) {
                $objectList[$id] = $object;
            }
        }

        return $objectList;
    }