40 lines
1.4 KiB
C#

// Copyright (C) 2025 Michael Becker <alcexhim@gmail.com>
//
// This file is part of Mocha.NET.
//
// Mocha.NET is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Mocha.NET is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Mocha.NET. If not, see <https://www.gnu.org/licenses/>.
namespace Mocha.Modeling.CodeGeneration.Expressions;
public class MethodCall : IMethodMember
{
public ObjectReference ObjectName { get; set; }
public string MethodName { get; set; }
public List<MethodParameter> Parameters { get; } = new List<MethodParameter>();
public IEnumerable<ObjectReference>? GenericParameters { get; set; } = null;
public MethodCall(IEnumerable<string> objectNames, string methodName, IEnumerable<object>? parmValues = null)
{
ObjectName = new ObjectReference(objectNames);
MethodName = methodName;
if (parmValues != null)
{
foreach (object parmValue in parmValues)
{
MethodParameter parm = new MethodParameter(parmValue);
Parameters.Add(parm);
}
}
}
}