DoopelPonger
|
A collection of methods used to read/write action patterns from/to a file. More...
Static Public Member Functions | |
static string | SerializeProperties (List< EditorActionInformation > editorActionInformation) |
Given a list of EditorActionInformation, serialize each object into a string and concatenate them with a ,. More... | |
static List< CoopActionItem > | DeserializeActionItems (string patternString, IDictionary< CoopActionPatternCreator.ActionType, CoopActionRuntimeInformation > runtimeInformationMap) |
Given the string of EditorActionInformation(s), serialized by the method SerializeProperties, convert them to the appropriate EditorActionInforamtion and ActionType. More... | |
static CoopActionInformation [] | DeserializeActionItemsToActionInformation (string patternString, IDictionary< CoopActionPatternCreator.ActionType, CoopActionRuntimeInformation > runtimeInformationMap) |
Given the string of EditorActionInformation(s), serialized by the method SerializeProperties, convert them to the appropiate CoopActionInformation. The CoopActionInformation is used by the SchmittyDoop class in the game to do attack patterns. More... | |
static string | GetPropertyStringValueFromRegex (Regex regex, string stringToMatch) |
Utility method to return the first regex match for the given regex and stringToMatch. More... | |
static Vector3 | GetVector3Property (Regex regex, string stringToMatch) |
Utility method to return the Vector3 found in the stringToMatch. More... | |
static Range | GetRangeProperty (Regex regex, string stringToMatch) |
Utility method to return the Range found in the stringToMatch. More... | |
static T | GetEnumProperty< T > (Regex regex, string stringToMatch) |
Utility method to return the enum found in the stringToMatch. More... | |
Static Public Attributes | |
static readonly string | ACTION_PATTERN_SAVE_DIRECTORY = "/ActionPatterns/" |
static readonly string | VALUE_DELIMITER = ":" |
static readonly string | PROPERTY_DELIMITIER = "," |
static readonly string | OBJECT_START_CHARACTER = "{" |
static readonly string | OBJECT_END_CHARACTER = "}" |
static readonly string | OBJECT_DELIMITER = "," |
static readonly string | ERROR_STRING = "" |
static readonly string | DELAY_BETWEEN_ACTIONS = "delayBetweenActions" + EditorActionInformationSerializer.VALUE_DELIMITER |
static readonly string | ACTION_TYPE = "actionType" + EditorActionInformationSerializer.VALUE_DELIMITER |
static readonly string | CLASS = "class" + EditorActionInformationSerializer.VALUE_DELIMITER |
static readonly string | SPAWN_LOCATION = "spwanLocation" + EditorActionInformationSerializer.VALUE_DELIMITER |
static readonly string | ATTACK_TYPE = "attackType" + EditorActionInformationSerializer.VALUE_DELIMITER |
static readonly string | ANGLE_OFFSET = "angleOffset" + EditorActionInformationSerializer.VALUE_DELIMITER |
static readonly string | NUMBER_OF_BALLS = "numberOfBalls" + EditorActionInformationSerializer.VALUE_DELIMITER |
static readonly string | BALL_MOVEMENT_TYPE = "ballMovementType" + EditorActionInformationSerializer.VALUE_DELIMITER |
static readonly string | NUMBER_OF_SPLITTERS = "numberOfSplitters" + EditorActionInformationSerializer.VALUE_DELIMITER |
static readonly string | NUMBER_OF_BAD_BALLS = "numberOfBadBalls" + EditorActionInformationSerializer.VALUE_DELIMITER |
static readonly string | SPLITTER_VELOCITY = "splitterVelocity" + EditorActionInformationSerializer.VALUE_DELIMITER |
static readonly string | BAD_BALL_VELOCITY = "badBallVelocity" + EditorActionInformationSerializer.VALUE_DELIMITER |
static readonly string | LENGTH = "length" + EditorActionInformationSerializer.VALUE_DELIMITER |
static readonly string | WIDTH = "width" + EditorActionInformationSerializer.VALUE_DELIMITER |
static readonly string | VELOCITY = "velocity" + EditorActionInformationSerializer.VALUE_DELIMITER |
static readonly string | GROWTH_RATE = "growthRate" + EditorActionInformationSerializer.VALUE_DELIMITER |
static readonly string | BALL_VELOCITY = "ballVelocity" + EditorActionInformationSerializer.VALUE_DELIMITER |
static readonly string | DECREASE_AMOUNT = "decreaseAmount" + EditorActionInformationSerializer.VALUE_DELIMITER |
static readonly string | INITIAL_SPEED = "initialSpeed" + EditorActionInformationSerializer.VALUE_DELIMITER |
static readonly string | INCREASE_AMOUNT = "increaseAmount" + EditorActionInformationSerializer.VALUE_DELIMITER |
static readonly string | ALPHA_CHANGE_RATE = "alphaChangeRate" + EditorActionInformationSerializer.VALUE_DELIMITER |
static readonly string | ROTATION_OFFSET = "rotationOffset" + EditorActionInformationSerializer.VALUE_DELIMITER |
static readonly string | MAX_ROTATION_TIME = "maxRotationTime" + EditorActionInformationSerializer.VALUE_DELIMITER |
static readonly string | MOVEMENT_OFFSET = "movementOffset" + EditorActionInformationSerializer.VALUE_DELIMITER |
static readonly string | MAX_MOVEMENT_TIME = "maxMovementTime" + EditorActionInformationSerializer.VALUE_DELIMITER |
static readonly string | MOVEMENT_TYPE = "movementType" + EditorActionInformationSerializer.VALUE_DELIMITER |
static readonly string | POSITION = "position" + EditorActionInformationSerializer.VALUE_DELIMITER |
static readonly string | ROTATION = "rotation" + EditorActionInformationSerializer.VALUE_DELIMITER |
static readonly string | SPEED = "speed" + EditorActionInformationSerializer.VALUE_DELIMITER |
static readonly string | VIRTICAL_MOVEMENT_CUTOFF = "verticalMovementCutoff" + EditorActionInformationSerializer.VALUE_DELIMITER |
static readonly string | WAVELENGTH_MULTIPLIER = "wavelengthMultiplier" + EditorActionInformationSerializer.VALUE_DELIMITER |
static readonly string | AMPLITUDE = "amplitude" + EditorActionInformationSerializer.VALUE_DELIMITER |
static readonly string | RADIUS = "radius" + EditorActionInformationSerializer.VALUE_DELIMITER |
static readonly string | ANGLE_VELOCITY = "angleVelocity" + EditorActionInformationSerializer.VALUE_DELIMITER |
static readonly string | MATCH_FLOAT = @"\-?[0-9\.]+" |
static readonly Regex | CLASS_REGEX = new Regex(CLASS + MATCH_WORDS) |
static readonly Regex | ACTION_TYPE_REGEX = new Regex(ACTION_TYPE + MATCH_WORDS) |
static readonly Regex | SPAWN_LOCATION_REGEX = new Regex(SPAWN_LOCATION + MATCH_WORDS) |
static readonly Regex | ATTACK_TYPE_REGEX = new Regex(ATTACK_TYPE + MATCH_WORDS) |
static readonly Regex | DELAY_BETWEEN_ACTIONS_REGEX = new Regex(DELAY_BETWEEN_ACTIONS + MATCH_SUB_OBJECT) |
static readonly Regex | ANGLE_OFFSET_REGEX = new Regex(ANGLE_OFFSET + MATCH_SUB_OBJECT) |
static readonly Regex | NUMBER_OF_BALLS_REGEX = new Regex(NUMBER_OF_BALLS + MATCH_SUB_OBJECT) |
static readonly Regex | BALL_MOVEMENT_TYPE_REGEX = new Regex(BALL_MOVEMENT_TYPE + MATCH_WORDS) |
static readonly Regex | NUMBER_OF_SPLITTERS_REGEX = new Regex(NUMBER_OF_SPLITTERS + MATCH_SUB_OBJECT) |
static readonly Regex | NUMBER_OF_BAD_BALLS_REGEX = new Regex(NUMBER_OF_BAD_BALLS + MATCH_SUB_OBJECT) |
static readonly Regex | SPLITTER_VELOCITY_REGEX = new Regex(SPLITTER_VELOCITY + MATCH_SUB_OBJECT) |
static readonly Regex | BAD_BALL_VELOCITY_REGEX = new Regex(BAD_BALL_VELOCITY + MATCH_SUB_OBJECT) |
static readonly Regex | LENGTH_REGEX = new Regex(LENGTH + MATCH_SUB_OBJECT) |
static readonly Regex | WIDTH_REGEX = new Regex(WIDTH + MATCH_SUB_OBJECT) |
static readonly Regex | VELOCITY_REGEX = new Regex(VELOCITY + MATCH_SUB_OBJECT) |
static readonly Regex | GROWTH_RATE_REGEX = new Regex(GROWTH_RATE + MATCH_SUB_OBJECT) |
static readonly Regex | BALL_VELOCITY_REGEX = new Regex(BALL_VELOCITY + MATCH_SUB_OBJECT) |
static readonly Regex | DECREASE_AMOUNT_REGEX = new Regex(DECREASE_AMOUNT + MATCH_SUB_OBJECT) |
static readonly Regex | INITIAL_SPEED_REGEX = new Regex(INITIAL_SPEED + MATCH_SUB_OBJECT) |
static readonly Regex | INCREASE_AMOUNT_REGEX = new Regex(INCREASE_AMOUNT + MATCH_SUB_OBJECT) |
static readonly Regex | ALPHA_CHANGE_RATE_REGEX = new Regex(ALPHA_CHANGE_RATE + MATCH_SUB_OBJECT) |
static readonly Regex | ROTATION_OFFSET_REGEX = new Regex(ROTATION_OFFSET + MATCH_SUB_OBJECT) |
static readonly Regex | MAX_ROTATION_TIME_REGEX = new Regex(MAX_ROTATION_TIME + MATCH_SUB_OBJECT) |
static readonly Regex | MOVEMENT_OFFSET_REGEX = new Regex(MOVEMENT_OFFSET + MATCH_SUB_OBJECT) |
static readonly Regex | MAX_MOVEMENT_TIME_REGEX = new Regex(MAX_MOVEMENT_TIME + MATCH_SUB_OBJECT) |
static readonly Regex | POSITION_REGEX = new Regex(POSITION + MATCH_SUB_OBJECT) |
static readonly Regex | ROTATION_REGEX = new Regex(ROTATION + MATCH_SUB_OBJECT) |
static readonly Regex | SPEED_REGEX = new Regex(SPEED + MATCH_SUB_OBJECT) |
static readonly Regex | VIRTICAL_MOVEMENT_CUTOFF_REGEX = new Regex(VIRTICAL_MOVEMENT_CUTOFF + MATCH_SUB_OBJECT) |
static readonly Regex | WAVELENGTH_MULTIPLIER_REGEX = new Regex(WAVELENGTH_MULTIPLIER + MATCH_SUB_OBJECT) |
static readonly Regex | AMPLITUDE_REGEX = new Regex(AMPLITUDE + MATCH_SUB_OBJECT) |
static readonly Regex | RADIUS_REGEX = new Regex(RADIUS + MATCH_SUB_OBJECT) |
static readonly Regex | ANGLE_VELOCITY_REGEX = new Regex(ANGLE_VELOCITY + MATCH_SUB_OBJECT) |
A collection of methods used to read/write action patterns from/to a file.
Entry point of reading/writing action patterns from/to a file. The action pattern scene will write the action patterns to a file and the game scene will read the patterns from a file for Schmitty Doop to use. The data that the Schmitty Doop class uses is slightly different than the data used in the inspector, so this class also provides a way to translate that information. Each EditorActionInformation is serializes with all its properties encased between {}. And each EditorActionInformation is seperated by ,
The serialized file with 3 pieces EditorActionInformation will look like: { delayBetweenActions: (min: 0, max: 20), actionType: MOVEMENT, <more properties>=""> }, { delayBetweenActions: (min: 10, max: 11), actionType: ATTACK, <more properties>=""> }, { delayBetweenActions: (min: 1, max: 2), actionType: ATTACK, <more properties>=""> }
|
static |
Given the string of EditorActionInformation(s), serialized by the method SerializeProperties, convert them to the appropriate EditorActionInforamtion and ActionType.
patternString | The serialized string of all the EditorActionInformation |
runtimeInformationMap | The runtime GameObjects used to instantiate the EditorActionInformation. Used when in the attack pattern editor scene to create objects. |
|
static |
Given the string of EditorActionInformation(s), serialized by the method SerializeProperties, convert them to the appropiate CoopActionInformation. The CoopActionInformation is used by the SchmittyDoop class in the game to do attack patterns.
patternString | The serialized string of all the EditorActionInformation |
runtimeInformationMap | The runtime GameObjects used to instantiate the CoopActionInformation objects. |
|
static |
Utility method to return the enum found in the stringToMatch.
regex | Regex to look for in the stringToMatch. |
stringToMatch | The string for the regex to parse through. |
|
static |
Utility method to return the first regex match for the given regex and stringToMatch.
regex | Regex to look for in the stringToMatch. |
stringToMatch | The string for the regex to parse through. |
|
static |
|
static |
Utility method to return the Vector3 found in the stringToMatch.
regex | Regex to look for in the stringToMatch. |
stringToMatch | The string for the regex to parse through. |
|
static |
Given a list of EditorActionInformation, serialize each object into a string and concatenate them with a ,.
editorActionInformation | List of EditorActionInformation that should be converted to a string. |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |