예제 #1
0
        // ładujemy się
        private static void Recharge()
        {
            int added = agentTomek.Recharge();

            energy += added;
            Console.WriteLine("Otrzymano " + added + " energii");
        }
예제 #2
0
        private static void Recharge()
        {
            int added = agentTomek.Recharge();

            if (energy + added >= cennikSwiata.initialEnergy)
            {
                int roznica = cennikSwiata.initialEnergy - energy;
                energy = cennikSwiata.initialEnergy;
                Console.WriteLine("Otrzymano " + roznica + " energii");
            }
            else
            {
                energy += added;
                Console.WriteLine("Otrzymano " + added + " energii");
            }

            energy += added;
            Console.WriteLine("Otrzymano " + added + " energii");
        }