Sayoregg
Sayoregg
CC#
Created by Sayoregg on 12/11/2024 in #help
Can't access method from one class in another even though it's set to public
Hi, I'm very new to C# and I'm currently making a small game for an assignment. I have a class called Entity and another called EntityGroupTemplates, where I want to store a few methods that return a specific 2D array of Entity objects. The code for the templates class looks like this:
internal class EntityGroupTemplates
{
public Entity[,] entityGroupTemplateStart()
{
Entity[,] template = new Entity[8, 12];

///Code to fill 2D array

return template;
}
}
internal class EntityGroupTemplates
{
public Entity[,] entityGroupTemplateStart()
{
Entity[,] template = new Entity[8, 12];

///Code to fill 2D array

return template;
}
}
The issue that I am unable to call the entityGroupTemplateStart method to provide that 2D array, and I'm not sure why. I am trying to call it within the main Game1.cs (I'm using the Monogame engine for the project)
7 replies