本文整理汇总了C#中ParameterSet类的典型用法代码示例。如果您正苦于以下问题:C# ParameterSet类的具体用法?C# ParameterSet怎么用?C# ParameterSet使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ParameterSet类属于命名空间,在下文中一共展示了ParameterSet类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateCamera
public static ICamera CreateCamera(ParameterSet parameters, AnimatedTransform cameraToWorld, IFilm film)
{
double shutteropen = parameters.FindOneDouble ("shutteropen", 0.0);
double shutterclose = parameters.FindOneDouble ("shutterclose", 1.0);
double lensradius = parameters.FindOneDouble ("lensradius", 0.0);
double focaldistance = parameters.FindOneDouble ("focaldistance", 1E+30);
double frame = parameters.FindOneDouble ("frameaspectratio", (double)(film.xResolution) / (double)(film.yResolution));
double[] screen = new double[4];
if (frame > 1.0)
{
screen[0] = -frame;
screen[1] = frame;
screen[2] = -1.0;
screen[3] = 1.0;
} else
{
screen[0] = -1.0;
screen[1] = 1.0;
screen[2] = -1.0 / frame;
screen[3] = 1.0 / frame;
}
int swi = 0;
double[] sw = parameters.FindDouble ("screenwindow", ref swi);
if (sw != null && swi == 4)
screen = sw;
double fov = parameters.FindOneDouble ("fov", 90.0);
return new Perspective (cameraToWorld, screen, shutteropen, shutterclose, lensradius, focaldistance, fov, film);
}
示例2: InitEnemyPools
private void InitEnemyPools(ref ParameterSet Parm)
{
availableWeakAI = new LinkedList<AI>();
availableRangedAI = new LinkedList<AI>();
availableHeavyAI = new LinkedList<AI>();
//add the number of enemies in the file
Vector3 zero = Vector3.Zero;
int num;
if (Parm.HasParm("EnemyWeakPoolSize"))
num = Parm.GetInt("EnemyWeakPoolSize");
else num = 0;
for(int i = 0; i < num; i++)
PreLoad("EnemyWeak", ref zero, ref zero);
if (Parm.HasParm("EnemyRangedPoolSize"))
num = Parm.GetInt("EnemyRangedPoolSize");
else num = 0;
for (int i = 0; i < num; i++)
PreLoad("EnemyRanged", ref zero, ref zero);
if (Parm.HasParm("EnemyHeavyPoolSize"))
num = Parm.GetInt("EnemyHeavyPoolSize");
else num = 0;
for(int i = 0; i < num; i++)
PreLoad("EnemyHeavy", ref zero, ref zero);
ShutdownAll();
}
示例3: GetTestCases
/// <summary>
/// Gets the test cases generated by the CombiningStrategy.
/// </summary>
/// <returns>The test cases.</returns>
public IEnumerable<ITestCaseData> GetTestCases(IEnumerable[] sources)
{
List<ITestCaseData> testCases = new List<ITestCaseData>();
IEnumerator[] enumerators = new IEnumerator[sources.Length];
for (int i = 0; i < sources.Length; i++)
enumerators[i] = sources[i].GetEnumerator();
for (; ; )
{
bool gotData = false;
object[] testdata = new object[sources.Length];
for (int i = 0; i < sources.Length; i++)
if (enumerators[i].MoveNext())
{
testdata[i] = enumerators[i].Current;
gotData = true;
}
else
testdata[i] = null;
if (!gotData)
break;
ParameterSet parms = new ParameterSet(testdata);
testCases.Add(parms);
}
return testCases;
}
示例4: Serialize
public override void Serialize(ref ParameterSet parm)
{
parm.AddParm("InputAction", inputAction.name);
parm.AddParm("KillOnButtonPush", killOnButtonPush);
base.Serialize(ref parm);
}
示例5: GetRModelInstance
public static RModelInstance GetRModelInstance(ParameterSet parm)
{
if (parm.HasParm("ModelType"))
if (parm.GetString("ModelType") == "Skinned")
return new SkinnedRModelInstance(parm);
return new RModelInstance(parm);
}
示例6: CreateActor
public Actor CreateActor(ParameterSet parm, string instanceName, ref Vector3 position, ref Vector3 rotation, Stage stage)
{
Actor newActor = new Actor(parm, instanceName, ref position, ref rotation, Stage.Content, stage);
actors.AddLast(newActor);
NotifyActorCreatedList(newActor);
return newActor;
}
示例7: Main
internal static int Main(string[] args)
{
if (args.Length == 0 && false == Environment.UserInteractive)
{
// Called by SCM
ServiceBase.Run(new TraceEventServiceHost());
return (int)ApplicationExitCode.Success;
}
var options = new ParameterOptions();
var parameters = new ParameterSet
{
{ "i|install", Resources.InstallArgDescription, (p, a) => options.Install(a) },
{ "u|uninstall", Resources.UninstallArgDescription, (p, a) => options.Uninstall() },
{ "s|start", Resources.StartArgDescription, (p, a) => options.Start(a) },
{ "c|console", Resources.ConsoleArgDescription, (p, a) => options.ConsoleMode() },
{ "h|help|?", Resources.HelpArgDescription, (p, a) => options.ShowHelp(p) },
{ "a|account", Resources.AccountArgDescription, ParameterOptions.AccountParameterKey }
};
options.ShowHeader();
if (!parameters.Parse(args))
{
options.ShowHelp(parameters);
return (int)ApplicationExitCode.InputError;
}
return (int)options.ExitCode;
}
示例8: LoadContent
public override void LoadContent(Microsoft.Xna.Framework.Content.ContentManager content, ParameterSet parm, Stage stage)
{
if (contentLoaded)
return;
bool initialized = false;
model = BasicModelLoad(parm, out initialized);
if (!initialized)
{
foreach (ModelMesh mesh in model.Meshes)
{
foreach (ModelMeshPart part in mesh.MeshParts)
{
Water effect = new Water(content.Load<Effect>("Effects/v2/Water"));
if (stage.Parm.HasParm("WaterSpecularPower"))
effect.SpecularPower = stage.Parm.GetFloat("WaterSpecularPower");
if (stage.Parm.HasParm("WaterShininess"))
effect.Shininess = stage.Parm.GetFloat("WaterShininess");
if (stage.Parm.HasParm("WaterColor"))
effect.WaterColor = stage.Parm.GetVector4("WaterColor");
if (stage.Parm.HasParm("WaterBase"))
effect.WaterBase = stage.Parm.GetVector4("WaterBase");
part.Effect = effect;
}
}
}
transforms = new Matrix[model.Bones.Count];
model.CopyAbsoluteBoneTransformsTo(transforms);
base.LoadContent(content, parm, stage);
}
示例9: CreateAreaLight
public static AreaLight CreateAreaLight(Transform lightToWorld, ParameterSet paramSet, IShape shape)
{
Spectrum L = paramSet.FindOneSpectrum ("L", new Spectrum (1.0));
Spectrum sc = paramSet.FindOneSpectrum ("scale", new Spectrum (1.0));
int nSamples = paramSet.FindOneInt ("nsamples", 1);
return new DiffuseAreaLight (lightToWorld, L * sc, nSamples, shape);
}
示例10: Camera
public static void Camera(string name, ParameterSet parameterSet)
{
Api.RenderOptions.CameraName = name;
Api.RenderOptions.CameraParameters = parameterSet;
Api.RenderOptions.CameraToWorld = CurrentTransform.Inverse;
NamedCoordinateSystems["camera"] = new TransformSet (Api.RenderOptions.CameraToWorld);
}
示例11: ParameterSetResult
public ParameterSetResult(NodeSequence arguments, ParameterSet parameterSet, object setInstance, IEnumerable<BindError> errors)
{
this.Arguments = arguments;
this.ParameterSet = parameterSet;
this.Object = setInstance;
this.Errors = errors.ToArray();
}
示例12: ParseParmSet
public static new void ParseParmSet(ref ParameterSet actorParm, ref ParameterSet worldParm)
{
if (worldParm.HasParm("Strength"))
actorParm.AddParm("Strength", worldParm.GetFloat("Strength"));
if (worldParm.HasParm("Direction"))
actorParm.AddParm("Direction", worldParm.GetVector3("Direction"));
}
示例13: ParseParmSet
public static void ParseParmSet(ref ParameterSet actorParm, ref ParameterSet worldParm)
{
if (worldParm.HasParm("DieOnTrigger"))
actorParm.AddParm("DieOnTrigger", worldParm.GetBool("DieOnTrigger"));
if (worldParm.HasParm("InputAction"))
actorParm.AddParm("InputAction", worldParm.GetString("InputAction"));
}
示例14: MainForm
public MainForm()
{
InitializeComponent();
agentParms = ParameterSet.FromFile("../../../../../Editor/listAgents.parm");
openToolStripMenuItem.Enabled = true;
saveToolStripMenuItem.Enabled = true;
buttonPause.Enabled = false;
buttonStop.Enabled = false;
buttonStart.Enabled = true;
actorEditButton.Enabled = false;
actorRemoveButton.Enabled = false;
this.stageControl = new StageControl(this);
//this.stageControl.Size = new System.Drawing.Size(1280, 720);
//this.stageControl.Location = new System.Drawing.Point(100, 50);
this.stageControl.Anchor = (AnchorStyles.Bottom | AnchorStyles.Right);
this.stageControl.Dock = DockStyle.Fill;
this.splitContainer1.Panel2.Controls.Add(stageControl);
//this.Controls.Add(stageControl);
//this.stageControl.PropertiesPanel = this.PropertiesPanel;
foreach (string actorFile in System.IO.Directory.EnumerateFiles("../../../../HeroesOfRockContent/Actors/"))
{
this.actorListBox.Items.Add(System.IO.Path.GetFileNameWithoutExtension(actorFile));
}
propertiesChanged = false;
}
示例15: AzureEndPointConfigInfo
// NoLB parameter set
public AzureEndPointConfigInfo(ParameterSet paramset,
ProtocolInfo endpointProtocol,
int endpointLocalPort,
int endpointPublicPort,
string endpointName,
NetworkAclObject aclObj = null,
bool directServerReturn = false,
string internalLoadBalancer = null,
string serviceName = null,
string loadBalancerDistribution = null,
string VirtualIPName = null)
{
this.Initialize(
endpointProtocol,
endpointLocalPort,
endpointPublicPort,
endpointName,
string.Empty,
0,
ProtocolInfo.tcp,
string.Empty,
null,
null,
paramset,
aclObj,
directServerReturn,
internalLoadBalancer,
serviceName,
loadBalancerDistribution,
VirtualIPName);
}