+ 1
Im getting a object not defined exception and I dont know why, I even asked a friend and they couldnt find the issue.
5 odpowiedzi
+ 2
I would recommend you to reduce your code to only one class and check the functionality. If that works then you can add a new class and check etc. So you can step by step extend your code and see what make eventually problems.
0
Can you US your desired output?
0
It doesnt have an output yet, i just want the code to run without an error.
0
Try this
using System;
using System.Collections.Generic;
namespace Sololearn
{
class Program
{
static void Main(string[] args)
{
int input = 1;
Generate generate = new Generate(input);
}
}
class Generate
{
enum Group
{
Friends,
Family,
Crushes,
Enemies
}
private int userInput;
public const int NO_OF_PEOPLE = 5;
public const int NO_OF_ROOMS = 4;
private List<Person>[] roomsArr = new List<Person>[NO_OF_ROOMS];
private Person[] people = new Person[NO_OF_PEOPLE];
private Random rnd = new Random();
public Generate(int userInput)
{
this.userInput = userInput;
GeneratePeople();
PlacePeople();
// SimulateInteractions();
}
private void GeneratePeople()
{
// Generiere jede Person
for (int i = 0; i < NO_OF_PEOPLE; i++)
0
The problem ended up being that i thought initializing an array of objects actually filled that array with instances of the class.