Code: Select all
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace problemexample
{
public class Stats
{
public int[] defStats = { 100, 15, 7 };
public void ChangeStat(int stat1, int stat2, int stat3)
{
defStats[0] = stat1;
defStats[1] = stat2;
defStats[2] = stat3;
}
}
internal class Program
{
static void Setup()
{
Stats player = new Stats();
int[] stats = player.defStats;
stats[0] = 150;
stats[1] = 30;
stats[2] = 10;
player.ChangeStat(stats[0], stats[1], stats[2]);
}
static void Main(string[] args)
{
Setup();
Stats player = new Stats();
int[] stats = player.defStats;
foreach (int i in stats)
{
Console.Write(i + " ");
}
Console.ReadKey();
}
}
}