if my child class holds only values that is getting access in another class should i make the child class a struct

if my child holds only values that is getting access in another class should i make the child class struct or a class
would it hurt or help performance?.
what the code might look like

skills{//child class
string skillname;
string skilldesc;
int stateffect1;
int stateffect2;
int stateffect3;
texture2d image;
int something[];
}

mainclass{
skills[] listofskills;
}

Firstly, be careful with the word “baseclass” because it means a class that another class is extending. Looking at your pseudo code it doesn’t look like that’s what you are doing

The main benefit of a struct is that it’s easy on the garbage collector.
The main disadvantage of it is that whenever you assign it or pass it as a parameter, it gets “copied”, which (depending on the “weight” of the struct) can get heavier than passing/assigning a class.

I’d say those are the most important points to consider.

If skills is something that you have a lot of or you create them constantly in the Update method or in loops etc. then using a struct might be good.

If skills is something that is stored for a longer time and passed around in your code, Class is a better option.

Looking at the variable names and imagining what skills could be used for, I’d probably make it Class.

Quoting from http://msdn.microsoft.com/

√ CONSIDER defining a struct instead of a class if instances of the type are small and commonly short-lived or are commonly embedded in other objects.

X AVOID defining a struct unless the type has all of the following characteristics:

  • It logically represents a single value, similar to primitive types (int, double, etc.)
  • It has an instance size under 16 bytes
  • It is immutable.
  • It will not have to be boxed frequently.

In all other cases, you should define your types as classes.