* @author Vasilis Georgoudis * @author Corentin Perrot */ class Pressbooks_Metadata_Game extends Pressbooks_Metadata_Type { /** * The variable that holds all parent required properties * * @since 0.13 * @access public */ static $required_parent_props = array( ); /** * The variable that holds the values for the settings for this schema type * * @since 0.13 * @access public */ static $type_setting = array('game_type' => array('Game Type','http://schema.org/Game')); /** * The variable that holds the parents for the type * * @since 0.13 * @access public */ static $type_parents = array( 'schemaTypes\Pressbooks_Metadata_Thing', 'schemaTypes\Pressbooks_Metadata_CreativeWork' ); /** * The variable that holds the properties of this schema type * * @since 0.13 * @access public */ static $type_properties = array( 'characterAttribute' => array(false,'Character Attribute','A piece of data that represents a particular aspect of a fictional character (skill, power, character points, advantage, disadvantage).'), 'gameItem' => array(false,'Game Item','An item is an object within the game world that can be collected by a player or, occasionally, a non-player character.'), 'gameLocation' => array(false,'Game Location','Real or fictional location of the game (or part of game).'), 'numberOfPlayers' => array(false,'Number Of Players','Indicate how many people can play this game (minimum, maximum, or range).'), 'quest' => array(false,'Quest','The task that a player-controlled character, or group of characters may complete in order to gain a reward.') ); public function __construct($type_level_input) { parent::__construct($type_level_input); $this->type_fields = $this->get_all_properties(); $this->class_name = __CLASS__ .'_'. $this->type_level; $this->pmdt_populate_names(self::$type_setting); $this->pmdt_add_metabox($this->type_level); } /** * Function used for combining the current types properties with its parents fields * * @since 0.13 * @access public */ public function get_all_properties() { $properties = self::$type_properties; foreach(self::$type_parents as $parentType){ $properties = array_merge($properties,$parentType::type_properties); } return $properties; } /** * Function used for comparing the instances of the schema types * * @since 0.13 * @access public */ public function __toString() { return $this->class_name; } }