Я создал класс игрока, и я пытаюсь использовать свой класс игрока, чтобы удалить плеер для моей программы, управляемой меню, но я продолжаю получать ошибку: Can not Implicitly convert type int [] to int 'с моим методом ProcessDelete. Мой метод ProcessDelete должен удалить все данные игрока, когда пользователь вводит номер игрока.Невозможно Implicitly конвертировать тип int [] в int
Любая помощь будет оценена по достоинству.
static Int32 ProcessDelete(Player[] players, Int32 RemoveAt)
{
Int32[] newIndicesArray = new Int32[players.Length - 1];
int i = 0;
int j = 0;
while (i < players.Length)
{
if (i != RemoveAt)
{
newIndicesArray[j] = players[i];
j++;
}
i++;
}
return newIndicesArray;
}
static void DeletePlayer(Int32 number, String firstName, String lastName, Int32 goals,
Int32 assists, Player[] players, ref Int32 playerCount, Int32 MAXPLAYERS)
{
int player;// Player number to delete
int playerindex;//index of the player number in Array
if (playerCount < MAXPLAYERS)
{
player = GetPositiveInteger("\nDelete Player: please enter the player's number");
playerindex = GetPlayerIndex(number, firstName, lastName, goals, assists, players, ref playerCount);
if (playerindex != -1)
{
{
Console.WriteLine("\nDelete Player: Number - {0}, Name - {1}, Points - {2}", players[playerindex].Number, firstName[playerindex], lastName[playerindex], players[playerindex].Goals, players[playerindex].Assists);
Console.WriteLine("Succesfully Deleted");
Console.WriteLine();
ProcessDelete(players);
}
}
else
Console.WriteLine("\nDelete Player: player not found");
}
else
Console.WriteLine("\nDelete Player: the roster is empty");
}
}
}
Какая часть ошибки вы не понимаете? – SLaks