/** * Pull a stripped down set of player data to display to the skill user. */ private function pullSightData(Player $target) { $data = $target->data(); // Strip all fields but those allowed. $allowed = ['Name' => 'uname', 'Class' => 'class_name', 'Turns' => 'turns', 'Strength' => 'strength', 'Speed' => 'speed', 'Stamina' => 'stamina', 'Ki' => 'ki', 'Gold' => 'gold', 'Kills' => 'kills']; $res = array(); foreach ($allowed as $header => $field) { $res[$header] = $data[$field]; } return $res; }