Daily update on 20250302-043034 by Nitload Youmu.

Signed-off-by: Nitload <YoumuLiu_NSI@whv0t.onmicrosoft.com>
This commit is contained in:
Nitload
2025-03-02 04:30:34 +08:00
parent b4b90da372
commit d12bbbd873
18 changed files with 257 additions and 68 deletions
@@ -37,7 +37,7 @@ using System.Text;
namespace StgSharp.Script.Express
{
public abstract class ExpCollectionBase : IExpElementSource, IEnumerable<ExpElementInstanceBase>
public abstract class ExpCollectionBase : ExpInstantiableElementBase, IEnumerable<ExpElementInstanceBase>
{
protected internal string _accurateType;
@@ -47,39 +47,38 @@ namespace StgSharp.Script.Express
_accurateType = accurateType;
}
public ExpElementType ElementType => ExpElementType.Collection;
public override ExpElementType ElementType => ExpElementType.Collection;
public abstract int Count
{
get;
}
public override sealed IScriptSourceProvider SourceProvider => ScriptSourceTransmitter.Empty;
public string MemberType
{
get => _accurateType;
}
public abstract string Name
{
get;
}
public void Analyse()
public override void Analyse()
{
return;
}
public abstract IEnumerator<ExpElementInstanceBase> GetEnumerator();
public abstract bool IsConvertable( IExpElementSource targetType );
public override sealed bool IsConvertable(
ExpInstantiableElementBase targetType )
{
return false;
}
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
IScriptSourceProvider IExpElementSource.SourceProvider => null!;
}
public class ExpArray : ExpCollectionBase
@@ -106,17 +105,17 @@ namespace StgSharp.Script.Express
public override string Name => ExpCompile.PoolString( "ARRAY" );
public override ExpBaseNode CreateInstanceNode()
{
throw new NotImplementedException();
}
public override IEnumerator<ExpElementInstanceBase> GetEnumerator()
{
return ( ( IEnumerable<ExpElementInstanceBase> )_collection )
.GetEnumerator();
}
public override bool IsConvertable( IExpElementSource targetType )
{
throw new NotImplementedException();
}
}
public class ExpBag : ExpCollectionBase
@@ -131,16 +130,16 @@ namespace StgSharp.Script.Express
public override string Name => ExpCompile.PoolString( "BAG" );
public override ExpBaseNode CreateInstanceNode()
{
throw new NotImplementedException();
}
public override IEnumerator<ExpElementInstanceBase> GetEnumerator()
{
return _collection.GetEnumerator();
}
public override bool IsConvertable( IExpElementSource targetType )
{
throw new NotImplementedException();
}
}
public sealed class ExpList : ExpCollectionBase
@@ -155,16 +154,16 @@ namespace StgSharp.Script.Express
public override string Name => ExpCompile.PoolString( "LIST" );
public override ExpBaseNode CreateInstanceNode()
{
throw new NotImplementedException();
}
public override IEnumerator<ExpElementInstanceBase> GetEnumerator()
{
return _collection.GetEnumerator();
}
public override bool IsConvertable( IExpElementSource targetType )
{
throw new NotImplementedException();
}
}
public class ExpSet : ExpCollectionBase
@@ -187,6 +186,11 @@ namespace StgSharp.Script.Express
_collection.Add( token );
}
public override ExpBaseNode CreateInstanceNode()
{
throw new NotImplementedException();
}
public override sealed IEnumerator<ExpElementInstanceBase> GetEnumerator(
)
{
@@ -194,10 +198,5 @@ namespace StgSharp.Script.Express
.GetEnumerator();
}
public override bool IsConvertable( IExpElementSource targetType )
{
throw new NotImplementedException();
}
}
}