Skip to content

Commit

Permalink
remove DefineMethod, add IsInterface flag #61
Browse files Browse the repository at this point in the history
  • Loading branch information
0xF6 committed Jun 30, 2021
1 parent 2f95c3c commit c3667c4
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions backend/Common/reflection/ManaClass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public class ManaClass : IEquatable<ManaClass>, IAspectable
public ManaTypeCode TypeCode { get; set; } = TYPE_CLASS;
public bool IsPrimitive => TypeCode is not TYPE_CLASS and not TYPE_NONE;
public bool IsValueType => IsPrimitive || this.Walk(x => x.Name == "ValueType");
public virtual bool IsInterface => false;
public ManaModule Owner { get; set; }
public List<Aspect> Aspects { get; } = new();

Expand All @@ -29,19 +30,7 @@ internal ManaClass(QualityTypeName name, ManaClass parent, ManaModule module)
this.Owner = module;
}
protected ManaClass() { }

internal ManaMethod DefineMethod(string name, ManaClass returnType, MethodFlags flags, params ManaArgumentRef[] args)
{
var method = new ManaMethod(name, flags, returnType, this, args);
method.Arguments.AddRange(args);

if (Methods.Any(x => x.Name.Equals(method.Name)))
return Methods.First(x => x.Name.Equals(method.Name));

Methods.Add(method);
return method;
}


public bool IsSpecial => Flags.HasFlag(ClassFlags.Special);
public bool IsPublic => Flags.HasFlag(ClassFlags.Public);
public bool IsPrivate => Flags.HasFlag(ClassFlags.Private);
Expand Down

0 comments on commit c3667c4

Please sign in to comment.