本文整理汇总了C#中FastList类的典型用法代码示例。如果您正苦于以下问题:C# FastList类的具体用法?C# FastList怎么用?C# FastList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FastList类属于命名空间,在下文中一共展示了FastList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DynamicEffectCompiler
/// <summary>
/// Initializes a new instance of the <see cref="DynamicEffectCompiler" /> class.
/// </summary>
/// <param name="services">The services.</param>
/// <param name="effectName">Name of the effect.</param>
/// <param name="asyncDynamicEffectCompiler">if set to <c>true</c> it can compile effect asynchronously.</param>
/// <exception cref="System.ArgumentNullException">services
/// or
/// effectName</exception>
public DynamicEffectCompiler(IServiceRegistry services, string effectName, int taskPriority = 0)
{
if (services == null) throw new ArgumentNullException("services");
if (effectName == null) throw new ArgumentNullException("effectName");
Services = services;
this.effectName = effectName;
this.taskPriority = taskPriority;
EffectSystem = Services.GetSafeServiceAs<EffectSystem>();
GraphicsDevice = Services.GetSafeServiceAs<IGraphicsDeviceService>().GraphicsDevice;
parameterCollections = new FastList<ParameterCollection>();
// Default behavior for fallback effect: load effect with same name but empty compiler parameters
ComputeFallbackEffect = (dynamicEffectCompiler, type, name, parameters) =>
{
ParameterCollection usedParameters;
var compilerParameters = new CompilerParameters();
// We want high priority
compilerParameters.TaskPriority = -1;
var effect = dynamicEffectCompiler.EffectSystem.LoadEffect(effectName, compilerParameters, out usedParameters).WaitForResult();
return new ComputeFallbackEffectResult(effect, usedParameters);
};
}
示例2: DebugInfo
internal DebugInfo()
{
Scopes = new FastList<ScopeSym>();
Lines = new FastList<LineSym>();
Vars = new FastList<VarSym>();
Functions = new FastList<FunSym>();
}
示例3: EffectBarRenderer
public EffectBarRenderer(Bar bar, IEffectBarRendererInfo info)
: base(bar)
{
_info = info;
_uniqueEffectGlyphs = new FastList<FastList<EffectGlyph>>();
_effectGlyphs = new FastList<FastDictionary<int, EffectGlyph>>();
}
示例4: GroupedBarRenderer
public GroupedBarRenderer(Bar bar)
: base(bar)
{
_preBeatGlyphs = new FastList<Glyph>();
_voiceContainers = new FastDictionary<int, VoiceContainerGlyph>();
_postBeatGlyphs = new FastList<Glyph>();
}
示例5: EffectReflection
/// <summary>
/// Initializes a new instance of the <see cref="EffectReflection"/> class.
/// </summary>
public EffectReflection()
{
SamplerStates = new List<EffectSamplerStateBinding>();
ResourceBindings = new FastList<EffectResourceBindingDescription>();
ConstantBuffers = new List<EffectConstantBufferDescription>();
ShaderStreamOutputDeclarations = new List<ShaderStreamOutputDeclarationEntry>();
}
示例6: OptionPopUp
public OptionPopUp(string message)
: this(message, true)
{
//load saved values here
options = new FastList<OptionFunc>();
options.Add(ChangeMusicVol);
options.Add(ChangeFxVol);
options.Add(ChangeGore);
options.Add(ChangeMoreGore);
options.Add(ChangeStrum);
if (!Stage.Editor)
{
strumMode = Stage.SaveGame.getStrumMode();
Stage.SaveGame.getGores(out gore, out moreGore);
Stage.SaveGame.getVolumes(out musicVol, out fxVol);
}
origFXVol = fxVol;
origGore = gore;
origMoreGore = moreGore;
origMusicVol = musicVol;
PlayerAgent.isStrumMode = strumMode;
origStrumMode = strumMode;
Stage.ActiveStage.PauseGame();
}
示例7: ScoreNoteChordGlyph
public ScoreNoteChordGlyph()
: base(0, 0)
{
_infos = new FastList<ScoreNoteGlyphInfo>();
BeatEffects = new FastDictionary<string, Glyph>();
_noteLookup = new FastDictionary<int, Glyph>();
}
示例8: ProcessPacket
public static void ProcessPacket(FastList<byte> packet)
{
if (packet == null || packet.Count < 4) {
throw new System.Exception("Packet is null or not valid length");
}
int frameCount = BitConverter.ToInt32 (packet.innerArray, 0);
int index = 4;
if (FrameManager.HasFrame (frameCount) == false) {
Frame frame = new Frame ();
if (packet.Count > 4) {
RecordedBytes.AddRange (BitConverter.GetBytes ((ushort)packet.Count));
RecordedBytes.AddRange (packet);
while (index < packet.Count) {
Command com = new Command ();
index += com.Reconstruct (packet.innerArray, index);
frame.AddCommand (com);
}
if (frameCount > LastCommandedFrameCount) {
LastCommandedFrameCount = frameCount;
}
}
FrameManager.AddFrame (frameCount, frame);
} else {
}
}
示例9: FrustumCulling
// TODO: Find a way to replug this
/// <summary>
/// Adds a default frustum culling for rendering only meshes that are only inside the frustum/
/// </summary>
/// <param name="modelRenderer">The model renderer.</param>
/// <returns>ModelRenderer.</returns>
//public static ModelComponentRenderer AddDefaultFrustumCulling(this ModelComponentRenderer modelRenderer)
//{
// modelRenderer.UpdateMeshes = FrustumCulling;
// return modelRenderer;
//}
private static void FrustumCulling(RenderContext context, FastList<RenderMesh> meshes)
{
Matrix viewProjection, mat1, mat2;
// Compute view * projection
context.Parameters.Get(TransformationKeys.View, out mat1);
context.Parameters.Get(TransformationKeys.Projection, out mat2);
Matrix.Multiply(ref mat1, ref mat2, out viewProjection);
var frustum = new BoundingFrustum(ref viewProjection);
for (var i = 0; i < meshes.Count; ++i)
{
var renderMesh = meshes[i];
// Fast AABB transform: http://zeuxcg.org/2010/10/17/aabb-from-obb-with-component-wise-abs/
// Get world matrix
renderMesh.Mesh.Parameters.Get(TransformationKeys.World, out mat1);
// Compute transformed AABB (by world)
var boundingBoxExt = new BoundingBoxExt(renderMesh.Mesh.BoundingBox);
boundingBoxExt.Transform(mat1);
// Perform frustum culling
if (!frustum.Contains(ref boundingBoxExt))
{
meshes.SwapRemoveAt(i--);
}
}
}
示例10: 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);
}
示例11: CallPoint
internal CallPoint(int modHandle, EvalStack stack, ElaValue[] locals, FastList<ElaValue[]> captures)
{
ModuleHandle = modHandle;
Locals = locals;
Captures = captures;
Stack = stack;
}
示例12: Reconstruct
public int Reconstruct(AgentController agentController, byte[] source, int startIndex)
{
curIndex = startIndex;
Header = BitConverter.ToUInt64 (source, curIndex);
curIndex += 8;
if (selectedAgentLocalIDs == null)
selectedAgentLocalIDs = new FastList<int> (64);
else
selectedAgentLocalIDs.FastClear ();
for (i = 0; i < 64; i++) {
castedBigIndex = (ulong)1 << i;
if ((Header & castedBigIndex) == castedBigIndex) {
CullGroup = source [curIndex++];
for (j = 0; j < 8; j++) {
castedSmallIndex = (byte)(1 << j);
if ((CullGroup & (castedSmallIndex)) == castedSmallIndex)
{
selectedAgentLocalIDs.Add (i * 8 + j);
}
}
}
}
return curIndex - startIndex;
}
示例13: Blueprint
/// <summary>
/// Deserialization constructor.
/// </summary>
/// <param name="group">Market Group the Blueprint will be a member of.</param>
/// <param name="src">Source serializable blueprint.</param>
internal Blueprint(BlueprintMarketGroup group, SerializableBlueprint src)
: base(group, src)
{
m_maxProductionLimit = src.MaxProductionLimit;
m_produceItemID = src.ProduceItemID;
m_productionTime= src.ProductionTime;
m_productivityModifier = src.ProductivityModifier;
m_researchCopyTime = src.ResearchCopyTime;
m_researchMaterialTime = src.ResearchMaterialTime;
m_researchProductivityTime = src.ResearchProductivityTime;
m_researchTechTime = src.ResearchTechTime;
m_techLevel = src.TechLevel;
m_wasteFactor = src.WasteFactor;
// Invented blueprint
m_inventBlueprint = new FastList<int>(src.InventionTypeID != null ? src.InventionTypeID.Length : 0);
if (src.InventionTypeID != null)
{
foreach (var blueprintID in src.InventionTypeID)
{
m_inventBlueprint.Add(blueprintID);
}
}
// Materials prerequisites
m_materialRequirements = new FastList<StaticRequiredMaterial>(src.ReqMaterial != null ? src.ReqMaterial.Length : 0);
if (src.ReqMaterial == null)
return;
foreach (var prereq in src.ReqMaterial)
{
m_materialRequirements.Add(new StaticRequiredMaterial(prereq));
}
}
示例14: Note
public Note()
{
BendPoints = new FastList<BendPoint>();
Dynamic = DynamicValue.F;
Accentuated = AccentuationType.None;
Fret = int.MinValue;
HarmonicType = HarmonicType.None;
SlideType = SlideType.None;
Vibrato = VibratoType.None;
LeftHandFinger = Fingers.Unknown;
RightHandFinger = Fingers.Unknown;
TrillValue = -1;
TrillSpeed = Duration.ThirtySecond;
DurationPercent = 1;
Octave = -1;
Tone = -1;
Fret = -1;
String = -1;
Element = -1;
Variation = -1;
}
示例15: ScanAll
public void ScanAll(int deltaCount, FastList<LSAgent> outputAgents,
bool CheckAllegiance = false,
AllegianceType allegianceType = AllegianceType.Neutral)
{
for (i = 0; i < deltaCount; i++) {
tempNode = GridManager.GetNode (
LocatedNode.gridX + DeltaCache.CacheX[i],
LocatedNode.gridY + DeltaCache.CacheY[i]);
if (tempNode != null && tempNode.LocatedAgents != null) {
tempBucket = tempNode.LocatedAgents;
for (j = 0; j < tempBucket.PeakCount; j++) {
if (LSUtility.GetBitTrue (tempBucket.arrayAllocation, j)) {
tempAgent = tempBucket.innerArray [j].Agent;
if (System.Object.ReferenceEquals (tempAgent, Agent) == false) {
if (CheckAllegiance)
{
if (Agent.MyAgentController.DiplomacyFlags
[tempAgent.MyAgentController.ControllerID] != allegianceType) continue;
}
outputAgents.Add (tempAgent);
}
}
}
}
}
}