Chcę stworzyć obiekt klasy Robot który będzie domyślnie pobierał wartości z metod które mu przypisze, oraz jaki sposób będzie najlepszy na sumowanie zmiennych weight z wybranych metod ?
class Program
{
static void Main(string[] args)
{
Robot r1 = new Robot();
r1.Engine_great(200, "trlalla", 200);
r1.Skelly_A(400,300);
}
}
class Robot
{
public void Engine_medium(int power, string name, int weight)
{
power = 100;
weight = 230;
name = "ZX:A100 Engine with medium power and medium weight";
}
public void Engine_great(int power, string name, int weight)
{
power = 130;
weight = 350;
name = "ZX:S100 Engine with high power and great weight";
}
public void Skelly_A(int weight, int agility)
{
weight = 400;
agility = 10;
}
public void Skelly_S(int weight, int agility)
{
weight = 550;
agility = 15;
}
}
}