|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace GELightsCompiler
{
// represents a command
class Command
{
string _name; // name of the command
Int16 _number; // command number
int _parameters; // number of parameters
int[] _mins; // minimum values of parameters
int[] _maxs; // maximum values of parameters
bool[] _varsallowed;
string _prototype = string.Empty;
// create a command
public Command(string name, Int16 number, int parameters, int[] mins, int[] maxs, bool[] varsallowed, string prototype)
{
// save the values
_name = name;
_prototype = prototype;
_number = number;
_parameters = parameters;
_mins = mins;
_maxs = maxs;
_varsallowed = varsallowed;
}
public string Prototype
{
get
{
return _prototype;
}
}
// get the command name
public string Name
{
get
{
return _name;
}
}
// get the command number
public Int16 Number
{
get
{
return _number;
}
}
// get the number of parameters
public int Parameters
{
get
{
return _parameters;
}
}
// get the minimum for a given parameter
public int Min(int parm)
{
return _mins[parm];
}
// get the maximum for a given parameter
public int Max(int parm)
{
return _maxs[parm];
}
public bool VarsAllowed(int parm)
{
return _varsallowed[parm];
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.