// Use this for initialization void Start() { animator = GetComponent <Animator>(); //ustawienie podstawowego stanu landerState = new LanderIdle(this); mainEngine = new ThrusterScript(fuelrate, enginepower); //inicjacja silnika gamecontrol = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameController>(); //inicjacja paliw fuel = startingfuel; monoprop = startingmonoprop; }
private static void MarsLanderProblem() { // ! IDEA: create a "fitness score" that is higher when the ship is within the landing zone (X, Y) // and lower when it's outside (the farther out, the lower) var solver = new Solver(); var initial = new LanderState(new Position(2500, 2700), new Thrust(0, 3), new Speed(0, 0)); var solution = solver.Solve(initial); if (solution == null) { Console.WriteLine("No solution."); } else { var thrusts = solution .Cast <LanderState>() .Select(it => it.ToString()); File.WriteAllText(@"c:\temp\mars.txt", string.Join(Environment.NewLine, thrusts)); } }
// metoda zmieniajaca stan landera public void SetState(LanderState state) { landerState = state; }