Skip to content

Usage of functionMap file

Cem YILMAZ edited this page Sep 20, 2016 · 1 revision

Usage of functionMap file

Using the functionMap file is fairly simple.

There should be 3 properties and function parameters for every line.

Properties

  • Key: the function call key that the client will send to you(you can add or view them in here.
  • Handler Property Name: The handler property name in the FunctionHandler object. (Remember, it should be the property name. Not property type. So for audio handler, you should say AudioHandler instead of saying IAudioHandler.
  • Function Name: The function name that you want to execute.
  • **Function Properties(after >): The function properties. Look below for usage. **

Example:

Lets say that you want to map the function VolumeUpBy(int) from IAudioHandler.

  1. For key, you should go to Enums file and check for the function key(or add it if its not there.). At the moment, the function command value is 5.

  2. For Handler Property Name you should type AudioHandler since its the property name for it in the FunctionHandler object.

  3. For Function Name you should just simply say VolumeUpBy. Don't worry about the function parameter just yet.

Oh by the way, you should split every property with a -. Keep that in mind.

So, lets compile everything into a command, you should be having something like this:

5-AudioHandler-VolumeUpBy

This is enough for a function that doesn't need any parameters but in this case, VolumeUpBy function needs an int value parameter.

For function parameters, you should put a > at the end of the line. After that line you can define function parameters like this:

parametertype:parametervalue

Warning: this method only supports primitive types for now you can find the list and definitions here.

So for our VolumeUpBy example, i should be completing my entry like this:

5-AudioHandler-VolumeUpBy>System.Int32:50 - to pass 50 as an integer to function parameters.

Also, like property adding, if you want to add more than one parameter you should split them with - as well. As an example:

5-AudioHandler-VolumeUpBy>System.Int32:50-System.String:Lets not get it too loud!

Please keep in mind that this method is still experimental and under development.

Clone this wiki locally