public override IReadOnlyList <MetaOperationBuilder> MetaClass_GetAllFinalOperations(MetaClassBuilder _this) { var ops = _this.GetAllOperations(); var result = new List <MetaOperationBuilder>(ops); result.Reverse(); int i = result.Count - 1; while (i >= 0) { var currentOp = result[i]; MetaOperationBuilder op = result.First(o => o.ConformsTo(currentOp)); if (op != currentOp) { result.RemoveAt(i); } --i; } return(result); }
public override bool MetaOperation_ConformsTo(MetaOperationBuilder _this, MetaOperationBuilder operation) { if (operation == null) { return(false); } if (_this.Name != operation.Name) { return(false); } if (_this.Parameters.Count != operation.Parameters.Count) { return(false); } if (_this.Class != null && !_this.Class.ConformsTo(operation.Class)) { return(false); } if (_this.Enum != null && !_this.Enum.ConformsTo(operation.Enum)) { return(false); } if (!_this.ReturnType.ConformsTo(operation.ReturnType)) { return(false); } for (int i = 0; i < _this.Parameters.Count; i++) { var thisParam = _this.Parameters[i]; var otherParam = operation.Parameters[i]; if (!otherParam.Type.ConformsTo(thisParam.Type)) { return(false); } } return(true); }