-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
52 lines (43 loc) · 1.66 KB
/
Program.cs
File metadata and controls
52 lines (43 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OOP_Proiecte
{
internal class Program
{
// Creati un robot, care sa omoare toate creaturile de pe planeta Pamant.Setati intensitatea(Kill) tipul
// creaturilor si statusul lor(in viata sau nu).
static void Main(string[] args)
{
Planet earth = new Planet();
earth.Type = PlanetType.Earth;
earth.Creatures = new List<Creature>()
{
new Creature(){ Type = CreatureType.Animal },
new Creature(){ Type = CreatureType.SuperHeroe },
new Creature(){ Type = CreatureType.Human }
};
GiantKillerRobot robot = new GiantKillerRobot();
robot.Planet = earth;
robot.initialize();
robot.EyeLaserIntensity = Intensity.Kill;
robot.Target = new List<CreatureType>() { CreatureType.Animal, CreatureType.SuperHeroe, CreatureType.Human };
while (robot.Active && earth.ContainsLife)
{
if (robot.CurentTarget.IsAlive)
{
Console.WriteLine($"Our Target is : {robot.CurentTarget.Type}");
robot.FireLaserAt(robot.CurentTarget);
Console.WriteLine($"The Creature Type : {robot.CurentTarget.Type} was killed by Robot: {robot.Name}");
}
else
{
robot.AcquireNextTarget();
}
//Console.WriteLine($"Acquire next target, the previous was killed");
}
}
}
}