本文整理汇总了C#中ParameterSet类的典型用法代码示例。如果您正苦于以下问题:C# ParameterSet类的具体用法?C# ParameterSet怎么用?C# ParameterSet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ParameterSet类属于命名空间,在下文中一共展示了ParameterSet类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:Kintaro,项目名称:Hyperion,代码行数:28,代码来源:Perspective.cs
示例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();
}
开发者ID:scotttorgeson,项目名称:HeroesOfRock,代码行数:34,代码来源:AIQB.cs
示例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;
}
开发者ID:balaghanta,项目名称:nunit-framework,代码行数:35,代码来源:SequentialStrategy.cs
示例4: Serialize
public override void Serialize(ref ParameterSet parm)
{
parm.AddParm("InputAction", inputAction.name);
parm.AddParm("KillOnButtonPush", killOnButtonPush);
base.Serialize(ref parm);
}
开发者ID:scotttorgeson,项目名称:HeroesOfRock,代码行数:7,代码来源:ButtonPushTriggerVolume.cs
示例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);
}
开发者ID:scotttorgeson,项目名称:HeroesOfRock,代码行数:7,代码来源:RModelInstance.cs
示例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;
}
开发者ID:scotttorgeson,项目名称:HeroesOfRock,代码行数:7,代码来源:ActorQB.cs
示例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;
}
开发者ID:guyzo,项目名称:semantic-logging,代码行数:30,代码来源:Application.cs
示例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);
}
开发者ID:scotttorgeson,项目名称:HeroesOfRock,代码行数:34,代码来源:WaterRModel.cs
示例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);
}
开发者ID:Kintaro,项目名称:Hyperion,代码行数:7,代码来源:DiffuseAreaLight.cs
示例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);
}
开发者ID:Kintaro,项目名称:Hyperion,代码行数:7,代码来源:Api.cs
示例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();
}
开发者ID:LBiNetherlands,项目名称:LBi.Cli.Arguments,代码行数:7,代码来源:ParameterSetResult.cs
示例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"));
}
开发者ID:scotttorgeson,项目名称:HeroesOfRock,代码行数:7,代码来源:AirBurstTriggerVolume.cs
示例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"));
}
开发者ID:scotttorgeson,项目名称:HeroesOfRock,代码行数:7,代码来源:TriggerVolume.cs
示例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;
}
开发者ID:scotttorgeson,项目名称:HeroesOfRock,代码行数:29,代码来源:MainForm.cs
示例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);
}
开发者ID:FrankSiegemund,项目名称:azure-powershell,代码行数:32,代码来源:AzureEndPointConfigInfo.cs
示例16: listBoxForm
public listBoxForm(ParameterSet ps, Actor a, Manipulator m, MainForm ma)
{
InitializeComponent();
int index = 0;
selectedActor = a;
parms = ps;
man = m;
main = ma;
if (man != null)
man.enableRayCast = false;
if (selectedActor.Name.Contains("Trigger"))
triggerFlag = true;
string agents = "";
if (selectedActor.Parm.HasParm("Agents"))
agents = selectedActor.Parm.GetString("Agents");
foreach (KeyValuePair<string, string> s in ps)
{
if (index++ != 0)
{
this.listBox.Items.Add(s.Key);
foreach (string str in agents.Split(','))
{
if (str == s.Key)
listBox.SelectedIndices.Add(index - 2);
}
}
}
}
开发者ID:scotttorgeson,项目名称:HeroesOfRock,代码行数:32,代码来源:listBoxForm.cs
示例17: GetTestCases
/// <summary>
/// Gets the test cases generated by the CombiningStrategy.
/// </summary>
/// <returns>The test cases.</returns>
public override IEnumerable<ITestCaseData> GetTestCases()
{
List<ITestCaseData> testCases = new List<ITestCaseData>();
IEnumerator[] enumerators = new IEnumerator[Sources.Length];
int index = -1;
for (; ; )
{
while (++index < Sources.Length)
{
enumerators[index] = Sources[index].GetEnumerator();
if (!enumerators[index].MoveNext())
return testCases;
}
object[] testdata = new object[Sources.Length];
for (int i = 0; i < Sources.Length; i++)
testdata[i] = enumerators[i].Current;
ParameterSet parms = new ParameterSet(testdata);
testCases.Add(parms);
index = Sources.Length;
while (--index >= 0 && !enumerators[index].MoveNext()) ;
if (index < 0) break;
}
return testCases;
}
开发者ID:haf,项目名称:nunit-framework,代码行数:36,代码来源:CombinatorialStrategy.cs
示例18: RModel
public RModel(ParameterSet parm)
{
ModelInfo m;
m.modelName = parm.GetString("ModelName");
Name = m.modelName;
ShadowDrawLists = new FastList<RModelInstance>[Sun.NUM_CASCADES];
for (int i = 0; i < ShadowDrawLists.Length; i++)
ShadowDrawLists[i] = new FastList<RModelInstance>();
if (parm.HasParm("BumpMap"))
IsBumpMapped = true;
if (parm.HasParm("Shininess"))
Shininess = parm.GetFloat("Shininess");
if (parm.HasParm("SpecularPower"))
SpecularPower = parm.GetFloat("SpecularPower");
if (parm.HasParm("SpecularMap"))
IsSpecularMapped = true;
if (parm.HasParm("CastsShadows"))
CastsShadows = parm.GetBool("CastsShadows");
if (parm.HasParm("ReceivesShadows"))
ReceivesShadows = parm.GetBool("ReceivesShadows");
if (parm.HasParm("AlphaBlend"))
AlphaBlend = parm.GetBool("AlphaBlend");
m.textureName = "";
if (parm.HasParm("Texture"))
m.textureName = parm.GetString("Texture");
modelDictionary.Add(m, this);
Renderer.Instance.AddRModel(this);
}
开发者ID:scotttorgeson,项目名称:HeroesOfRock,代码行数:32,代码来源:RModel.cs
示例19: PreLoadInit
public override void PreLoadInit(ParameterSet Parm)
{
numEnemiesInLevel = 0;
aliveEnemies = new LinkedList<AI>();
spawners = new List<SpawnActorTriggerVolume>();
rand = new Random();
}
开发者ID:scotttorgeson,项目名称:HeroesOfRock,代码行数:7,代码来源:AIQB.cs
示例20: GetTestCases
/// <summary>
/// Gets the test cases generated by the CombiningStrategy.
/// </summary>
/// <returns>The test cases.</returns>
public override IEnumerable<ITestCaseData> GetTestCases()
{
List<ITestCaseData> testCases = new List<ITestCaseData>();
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;
}
开发者ID:haf,项目名称:nunit-framework,代码行数:31,代码来源:SequentialStrategy.cs
注:本文中的ParameterSet类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论