Example #1
0
        public static void Initialize(IDatabaseAccess access)
        {
            DatabaseAccess = access;

            Account = new Account();
            Character = new Character();
            Clan = new Clan();
            Convoy = new Convoy();
            Item = new Item();
            Realmlist = new Realmlist();
            Social = new Social();
            Vehicle = new Vehicle();
        }
 /// <summary>
 /// Mains the specified arguments.
 /// </summary>
 /// <param name="args">The arguments.</param>
 static void Main(string[] args)
 {
     // using convoy reader that self destroys itself
     // using convoy that self destroys itself
     using (ConvoyReader convoyReader = new ConvoyReader(@"..\..\..\train1.txt"))
         using (Convoy convoy = new Convoy(convoyReader.LocomotiveInfo, convoyReader.FilePath))
         {
             // check construction
             Console.Out.WriteLine(convoy.Locomotive);
             // all reads
             int i = 0;
             foreach (Operation o in convoyReader.OperationList)
             {
                 Console.Out.WriteLine(i + ".-" + o.Command.PadRight(12) + "|" + convoy.Transaction(o) + "|" + convoy.WeightInKilos.ToString().PadRight(6) + "|" + convoy.WagonStack.Count);
                 i++;
             }
             //check to string Console.Out.WriteLine(convoy.JournalLog.ToString());
             Console.In.ReadLine();
         }
 }
Example #3
0
 IEnumerator SpawnRutine()
 {
     for (;;)
     {
         if (spawnear)
         {
             for (int j = 0; j < CurWave.numOfConvoys; j++)
             {
                 int    indexSpawn   = Random.Range(0, actualSpawners.Count);
                 Convoy actualConvoy = SeleccionarConvoy();
                 for (int i = 0; i < (actualConvoy.monsters.Length + actualConvoy.NExtraMonsters); i++)
                 {
                     if (i != actualConvoy.monsters.Length + actualConvoy.NExtraMonsters - 1)
                     {
                         if (i < actualConvoy.monsters.Length) // para spawn monstruos basicos
                         {
                             spawnMonster(actualConvoy.monsters[i], indexSpawn);
                         }
                         else // para spawnear el componente aleatorio
                         {
                             int indxPXMonster = Random.Range(0, actualConvoy.posibleExtraMonsters.Length);
                             spawnMonster(actualConvoy.posibleExtraMonsters[indxPXMonster], indexSpawn);
                         }
                         yield return(new WaitForSeconds(CurWave.spawnTime + (CurWave.spawnTime * Random.Range(-0.35f, 0.4f))));
                     }
                     else
                     {
                         yield return(new WaitForSeconds(CurWave.spawnTimeConvoys + (CurWave.spawnTimeConvoys * Random.Range(-0.35f, 0.4f)))); // Cuando se acaba el convoy
                     }
                 }
             }
             spawnear = false;
         }
         yield return(new WaitForSeconds(8f)); // esperando a comenzar a volver a spawnear
     }
 }
 public void Setup()
 {
     Game  = new();
     Agent = (Convoy)Game.Agents[nameof(Convoy)];
 }