26. オレライブラリ
オブジェクトプール
public void ForEach(MyAction<T> func)
{
for (int i = 0; i < actorCount; i++)
{
func(ref Actors[i]);
}
}
27. オレライブラリ
Direct Mapping
#if XBOX360
Shape.SetToWritableVertexBuffer<T>(Actors, si, nsi - si);
#else
Shape.BeginAddInstance();
Shape BeginAddInstance()
for (int i = si; i < nsi; i++)
{
Draw(ref Actors[i]);
}
#endif
shape.Draw();
asm
{
vfetch pos, vi, position0
vfetch color, vi, color0
vfetch param0, ii, texcoord0
vfetch param1, ii, texcoord1
f h 1 ii d1
vfetch param2, ii, color1
};
28. オレライブラリ
MathUtil
public static float Sin(float a)
{
return (float)Math.Sin(a);
}
public static float Range(this Random random, float min, float max)
{
return ((float)random.NextDouble() * (max - min) + min);
}
29. オレDSL
コンテントパイプラインで処理する弾幕DSL
nway 5 25
fire -$2
fire 0 0.6
rep $1-1
fire $2*2/($1-1)
fire 0 0.6
vns
[
[ContentImporter(".sslb", DisplayName = "SSL-B File Importer")]
p ( , p y p )]
public class SslbImporter : SslImporter<Sslb>
{
public override void ParseCommand(string[] strs)
{
switch (strs[0])
{
case "fire“: