Do you think I could just leave this part blank and it'd be okay? We're just going to replace the whole thing with a header image anyway, right?
You are not logged in.
Pages: 1
do i need to eat medicine if i do this?
class Player
{
//stuffs
public TrollData troll = new TrollData();
}
class TrollData
{
public bool vertical { get; set; }
public bool horizontal { get; set; }
public bool straightline { get; set; }
public bool filling { get; set; }
public double blockdistance { get; set; }
public int penalty { get; set; }
}
Players.Add(e.GetInt(0), new Player()
{
}
how do i initiate the variables in the trolldata?
Offline
class TrollData
{
public bool vertical = false;
public bool horizontal = false;
public bool straightline = false;
public bool filling = false;
public double blockdistance = 1.0;
public int penalty = 0;
}
Whats wrong with this ^?
Also penalty should be a long long unsigned int trust me.
Edit: Or you mean a constructor?
Everybody edits, but some edit more than others
Offline
Offline
You can try this:
Players.Add(e.GetInt(0), new Player(){
username = e.GetString(1),
troll = new TrollData(){
}
});
Everybody edits, but some edit more than others
Offline
Offline
class TrollData
{
public bool vertical { get; set; }
public bool horizontal { get; set; }
public bool straightline { get; set; }
public bool filling { get; set; }
public double blockdistance { get; set; }
public int penalty { get; set; }
public TrollData(bool v,bool h,bool s,bool f,double b,int p)
{
vertical = v;
horizontal = h;
straightline =s;
filling = f;
blockdistance = b;
penalty = p;
}
}
class Player
{
string name;
Trolldata troll;
public Player(string name, Trolldata troll)
{
this.name = name;
this.troll = troll;
}
}
player p = new player(m.getstring(1),new Trolldata(true,true,true,true,0,0));
players.add(m.getstring(0),p);
if you can read this....good for you
Offline
Offline
Pages: 1
[ Started around 1732810939.0967 - Generated in 0.066 seconds, 12 queries executed - Memory usage: 1.4 MiB (Peak: 1.51 MiB) ]