T
Tommy Lang
Why doesn't the following code work?
I get an error at the following line...
CardGroup[0].PropertyCardType = (CardType)0;
The error is "Object reference not set to an instance of an object.", which
means the object in question have not been initiated.
But I have init the object above n this line...
public Card [] CardGroup = new Card[53];
Anybody knows how to resolve this??
Thanks
namespace CardLibrary
{
public class CardFactory
{
//Create and init CardGroup
public Card [] CardGroup = new Card[53];
//Construktor
public CardFactory()
{
CardGroup[0].PropertyCardType = (CardType)0;
Console.WriteLine("Konstruktor: public CardFactory()");
}
} //Slut public class CardFactory
} //Slut namespace CardLibrary
I get an error at the following line...
CardGroup[0].PropertyCardType = (CardType)0;
The error is "Object reference not set to an instance of an object.", which
means the object in question have not been initiated.
But I have init the object above n this line...
public Card [] CardGroup = new Card[53];
Anybody knows how to resolve this??
Thanks

namespace CardLibrary
{
public class CardFactory
{
//Create and init CardGroup
public Card [] CardGroup = new Card[53];
//Construktor
public CardFactory()
{
CardGroup[0].PropertyCardType = (CardType)0;
Console.WriteLine("Konstruktor: public CardFactory()");
}
} //Slut public class CardFactory
} //Slut namespace CardLibrary