THis is My Class
Code: Select all
class BlockType
{
public String blockName;
public String blockImage;
public Color blockColor;
public int blockStickyness;//0=None, 1=Landed
public BlockType()
{
blockName="Blank";
blockImage = null;
blockColor=Color.White;
blockStickyness = 0;
}
public BlockType(String blockName, Color blockColor, String blockImage, int blockStickyness)
{
}
public BlockType(BlockType previousBlockType)
{
blockName=previousBlockType.blockName;
blockImage = previousBlockType.blockImage;
blockColor=previousBlockType.blockColor;
blockStickyness =previousBlockType.blockStickyness;
}
Code: Select all
BlockType block0 = new BlockType(); // Works
BlockType block1 = new BlockType("RedVitamin",Color.Red,"Vitamin",1); // Works
BlockType block2 = new BlockType(block1); // Doesn't Work
BlockType[] blockTemplates = new BlockType[4];//Works
but then
blockTemplates[1] = new BlockType(); // Doesn't
Code: Select all
Array size cannot be specified in a variable declaration (try initializing with a 'new' expression)
Invalid token '=' in class, struct, or interface member declaration
Class, struct, or interface method must have a return type