Ejemplo n.º 1
0
 public void SetUnit(IMovable unit)
 {
     Debug.Assert(unit is DeathStar);
     mUnit = (DeathStar)unit;
 }
Ejemplo n.º 2
0
 public static Map GetRandomInstance3(int objCount, int width, int height)
 {
     Map map = new Map(width, height);
       Random r = new Random();
       for (int i=0; i<objCount; i++)
       {
       int allegianceNo = r.Next(3);
       Allegiance allegiance = Allegiance.Neutral;
       switch (allegianceNo)
       {
           case 0:
               allegiance = Allegiance.Player;
               break;
           case 1:
               allegiance = Allegiance.Neutral;
               break;
           case 2:
               allegiance = Allegiance.Computer;
               break;
       }
       int sizeNo = r.Next(3);
       PlanetSize size = PlanetSize.Medium;
       switch (sizeNo)
       {
           case 0:
               size = PlanetSize.Small;
               break;
           case 1:
               size = PlanetSize.Medium;
               break;
           case 2:
               size = PlanetSize.Large;
               break;
       }
       int noOfMinions = r.Next(50);
       int type = r.Next(6);
       int x = r.Next(width);
       int y = r.Next(height);
       Vector2 pos = new Vector2(x, y);
       GameObject unit = null;
       switch (type)
       {
           case 0:
               unit = new Asteroid(pos);
               break;
           case 1:
               unit = new DeathStar(pos, allegiance, noOfMinions);
               break;
           case 2:
               unit = new Defender(pos,allegiance);
               break;
           case 3:
               unit = new Interceptor(pos, allegiance);
               break;
           case 4:
               unit = new Planet(pos, allegiance, size, noOfMinions);
               break;
           case 5:
               unit = new Predator(pos, allegiance);
               break;
       }
       if (unit != null) map.mInitialGameObjects.Add(unit);
       }
       return map;
 }
Ejemplo n.º 3
0
 public GuardDeathStar(SpaceshipAi parent, DeathStar deathStar)
 {
     mParent = parent;
     mDeathStar = deathStar;
 }
Ejemplo n.º 4
0
 public DeathStar CreateDeathStar(Vector2 position, Allegiance allegiance, int numberOfMinions)
 {
     var unit = new DeathStar(position, allegiance, numberOfMinions);
       return unit;
 }