daily update on 20241002 by nitload youmu, intrinsic function rebuild, syntax style arrange

This commit is contained in:
Nitload
2024-10-03 04:03:06 +08:00
parent 0979123ac0
commit 6e2f93b053
265 changed files with 26732 additions and 19058 deletions
@@ -47,18 +47,21 @@ namespace StgSharp.Controls
private char[] displayIndex;
private char defaultChar;
Dictionary<char, PlainGeometryMesh> texIndex;
private Dictionary<char, PlainGeometryMesh> texIndex;
private int length;
PlainGeometryMesh _tittleMesh;
private PlainGeometryMesh _tittleMesh;
public CharacterLineIndexImage(
int length, char defaultChar, PlainGeometryMesh tittleMesh,
IEnumerable<(char, PlainGeometryMesh)> indexEnumeration)
int length,
char defaultChar,
PlainGeometryMesh tittleMesh,
IEnumerable<(char, PlainGeometryMesh)> indexEnumeration )
{
this.length = length;
displayIndex = new char[length];
_tittleMesh = tittleMesh;
texIndex = indexEnumeration.ToDictionary(item => item.Item1, item => item.Item2);
texIndex = indexEnumeration.ToDictionary(
item => item.Item1, item => item.Item2 );
}
public bool IsEntity
@@ -66,23 +69,32 @@ namespace StgSharp.Controls
get => true;
}
public ReadOnlySpan<vec4d> TextureBox
public ReadOnlySpan<Vec4> TextureBox
{
get => throw new NotSupportedException();
}
public Rectangle BoundingBox { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
public vec2d Position { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
public void Display(string message)
public Rectangle BoundingBox
{
if (string.IsNullOrEmpty(message))
{
get => throw new NotImplementedException();
set => throw new NotImplementedException();
}
public Vec2 Position
{
get => throw new NotImplementedException();
set => throw new NotImplementedException();
}
public void Display( string message )
{
if( string.IsNullOrEmpty( message ) ) {
message = string.Empty;
}
string result = (message.Length >= length) ?
message.Substring(message.Length - displayIndex.Length) :
message.PadLeft(length, defaultChar);
string result = ( message.Length >= length ) ?
message.Substring( message.Length - displayIndex.Length ) : message.PadLeft(
length, defaultChar );
displayIndex = result.ToCharArray();
}
@@ -90,9 +102,8 @@ namespace StgSharp.Controls
public IEnumerator<PlainGeometryMesh> GetEnumerator()
{
yield return _tittleMesh;
foreach (char item in displayIndex)
{
yield return texIndex[item];
foreach( char item in displayIndex ) {
yield return texIndex[ item ];
}
}