Hello, I am currently developing a level editor, and I am having some problems.
Firstly, I want to create different game objects to use in my level editor and, assign them arbitrary variables loaded from a file. I tried using a void* for this.
However, the variable that was of type int, I tried to assign to the void* did not seem to work, I tried looking up online on how to add a new int to a void*, but found no results :(
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WindowsFormsApplication1
{
class ObjectVariable
{
public ObjectVariable(uint a, string b, string c, string d)
{
variableType = a;
variableName = b;
switch (a)
{
//Can't do this :(.
case 0: variableValue = new int(System.Convert.ToInt32(c));
break;
}
variableDescription = c;
}
public uint variableType;
public string variableName;
public void* variableValue;
public string variableDescription;
}
}
So, How do I assign a new int to a void*?