Class: Utilities

Utilities

new Utilities()

Holds some helper methods for the application to reduce amount of code in other modules, and allow re-usability of functions.
Source:

Methods

convertJSONToManoeuvres(json) → {String}

Retreives the maneouvre input from the JSON file using the key defined in this modules private variable.
Parameters:
Name Type Description
json JSON Raw JSON representing OLAN input.
Source:
Returns:
manoeuvres String input of OLAN.
Type
String

convertManoeuvresToJSON(manoeuvres) → {JSON}

Takes the maneouvre input from the user and produces raw JSON using the JSON key in the private variables.
Parameters:
Name Type Description
manoeuvres String String input of OLAN.
Source:
Returns:
json Raw JSON representing OLAN input.
Type
JSON

hasUpperCase(str) → {Boolean}

Checks if a given set of letters contains any uppper case, if so, return true.
Parameters:
Name Type Description
str String A String to be checked if it contains upper case letters
Source:
Returns:
bool Variable indicating whether there are any upper case letters present.
Type
Boolean

loadTexture(objPath) → {THREE.Texture}

Loads up a texture form an image and returns it as a ThreeJS.Texture.
Parameters:
Name Type Description
objPath String Path to image representing texture.
Source:
Returns:
texture Three.JS texture for use on objects or meshes.
Type
THREE.Texture

startDownload(json, element)

Initiates the download of the JSON file containing the user's OLAN input.
Parameters:
Name Type Description
json JSON Raw JSON containing OLAN input.
element Element Element that initiates the download in the browser.
Source: