Updated to ManiaLink v3
This commit is contained in:
		| @@ -9,34 +9,37 @@ use FML\Types\ScriptFeatureable; | ||||
|  * ManiaLink Script Feature Class | ||||
|  * | ||||
|  * @author    steeffeen <mail@steeffeen.com> | ||||
|  * @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder | ||||
|  * @copyright FancyManiaLinks Copyright © 2017 Steffen Schröder | ||||
|  * @license   http://www.gnu.org/licenses/ GNU General Public License, Version 3 | ||||
|  */ | ||||
| abstract class ScriptFeature { | ||||
| abstract class ScriptFeature | ||||
| { | ||||
|  | ||||
| 	/** | ||||
| 	 * Collect the Script Features of the given objects | ||||
| 	 * | ||||
| 	 * @return ScriptFeature[] | ||||
| 	 */ | ||||
| 	public static function collect() { | ||||
| 		$params         = func_get_args(); | ||||
| 		$scriptFeatures = array(); | ||||
| 		foreach ($params as $object) { | ||||
| 			if ($object instanceof ScriptFeatureable) { | ||||
| 				$scriptFeatures = array_merge($scriptFeatures, $object->getScriptFeatures()); | ||||
| 			} else if ($object instanceof ScriptFeature) { | ||||
| 				array_push($scriptFeatures, $object); | ||||
| 			} | ||||
| 		} | ||||
| 		return $scriptFeatures; | ||||
| 	} | ||||
|     /** | ||||
|      * Collect the Script Features of the given objects | ||||
|      * | ||||
|      * @return ScriptFeature[] | ||||
|      */ | ||||
|     public static function collect() | ||||
|     { | ||||
|         $params         = func_get_args(); | ||||
|         $scriptFeatures = array(); | ||||
|         foreach ($params as $object) { | ||||
|             if ($object instanceof ScriptFeatureable) { | ||||
|                 $scriptFeatures = array_merge($scriptFeatures, $object->getScriptFeatures()); | ||||
|             } else if ($object instanceof ScriptFeature) { | ||||
|                 array_push($scriptFeatures, $object); | ||||
|             } | ||||
|         } | ||||
|         return $scriptFeatures; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Prepare the given Script for rendering by adding the needed Labels, etc. | ||||
|      * | ||||
|      * @param Script $script Script to prepare | ||||
|      * @return static | ||||
|      */ | ||||
|     public abstract function prepare(Script $script); | ||||
|  | ||||
| 	/** | ||||
| 	 * Prepare the given Script for rendering by adding the needed Labels, etc. | ||||
| 	 * | ||||
| 	 * @param Script $script Script to prepare | ||||
| 	 * @return static | ||||
| 	 */ | ||||
| 	public abstract function prepare(Script $script); | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user