Пример #1
0
        public override void Run()
        {
            Stragegy = new Solo(this);
            Stragegy.Init();

            while (true)
            {
                Stragegy.Run();
            }
        }
Пример #2
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = Overall.GetHashCode();
         hashCode = hashCode * 397 ^ (Solo != null ? Solo.GetHashCode() : 0);
         hashCode = hashCode * 397 ^ (Duo != null ? Duo.GetHashCode() : 0);
         hashCode = hashCode * 397 ^ (Trio != null ? Trio.GetHashCode() : 0);
         hashCode = hashCode * 397 ^ (Squad != null ? Squad.GetHashCode() : 0);
         hashCode = hashCode * 397 ^ (Ltm != null ? Ltm.GetHashCode() : 0);
         return(hashCode);
     }
 }
Пример #3
0
        public override void OnRobotDeath(RobotDeathEvent evnt)
        {
            base.OnRobotDeath(evnt);
            var _enemyCount = EnemyCount();
            var _teamCount  = TeamCount();
            var _turn       = 2;

            if (((_enemyCount <= _turn && _teamCount <= _enemyCount) || (_teamCount <= _enemyCount && _teamCount <= _turn)) && !(Stragegy is Solo))
            {
                // Big boss come last
                Stragegy = new Solo(this);
                Stragegy.Init();
            }
        }
Пример #4
0
        public override void OnRobotDeath(RobotDeathEvent evnt)
        {
            base.OnRobotDeath(evnt);

            // TL go first
            var _enemyCount = EnemyCount();
            var _teamCount  = TeamCount();
            var _turn       = 4;

            if (((_enemyCount <= _turn && _teamCount <= _enemyCount) || (_teamCount <= _enemyCount && _teamCount <= _turn)) && !(Stragegy is Solo))
            {
                Stragegy = new Solo(this);
                Stragegy.Init();
            }
        }
Пример #5
0
        public override void Run()
        {
            if (Others >= 5)
            {
                Stragegy = new Meele(this);
            }
            else
            {
                Stragegy = new Solo(this);
            }
            Stragegy.Init();

            while (true)
            {
                Stragegy.Run();
            }
        }
Пример #6
0
 public override void die()
 {
     if(left!=null)
     {
         FormationManager.INSTANCE.removeFormation(left);
         EnemyChaser leftChaser = left.ship as EnemyChaser;
         Solo leftFormation = new Solo(leftChaser, 100);
         leftChaser.setFormation(leftFormation);
         FormationManager.INSTANCE.add(leftFormation);
     }
     if(right!=null)
     {
         FormationManager.INSTANCE.removeFormation(right);
         EnemyChaser rightChaser = right.ship as EnemyChaser;
         Solo rightFormation = new Solo(rightChaser, 100);
         rightChaser.setFormation(rightFormation);
         FormationManager.INSTANCE.add(rightFormation);
     }
 }
Пример #7
0
    private void revalidateFormations()
    {
        formations.Clear();
        for (int i = 0; i + 2 < teamEins.childCount; i += 3)
        {
            Helper.createFormation(teamEins.GetChild(i + 1), teamEins.GetChild(i), teamEins.GetChild(i + 2), formations);

        }
        for (int i = teamEins.childCount - teamEins.childCount % 3; i < teamEins.childCount; i++)
        {
            EnemyChaser chaser = teamEins.GetChild(i).GetComponent<EnemyChaser>();
            //Check null in case we find the player
            if (chaser != null)
            {
                Solo formation = new Solo(teamEins.GetChild(i).GetComponent<Spaceship>(), 100);
                chaser.setFormation(formation);
                formations.Add(formation);
            }
        }

        for (int i = 0; i + 2 < teamZwei.childCount; i += 3)
        {
            Helper.createFormation(teamZwei.GetChild(i + 1), teamZwei.GetChild(i), teamZwei.GetChild(i + 2), formations);

        }
        for (int i = teamZwei.childCount - teamZwei.childCount % 3; i < teamZwei.childCount; i++)
        {
            EnemyChaser chaser = teamZwei.GetChild(i).GetComponent<EnemyChaser>();
            //Check null in case we find the player
            if (chaser != null)
            {
                Solo formation = new Solo(teamZwei.GetChild(i).GetComponent<Spaceship>(), 100);
                chaser.setFormation(formation);
                formations.Add(formation);
            }
        }

        foreach (Formation f in formations)
        {
            f.target = Helper.findRandomTarget(f).GetComponent<Spaceship>();
        }
    }
Пример #8
0
        /// <summary>
        /// Initialize Robotium, the BrightcoveVideoView and the EventEmitter.
        /// Start media playback. </summary>
        /// <exception cref="Exception"> </exception>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: @Override protected void setUp() throws Exception
        protected internal override void setUp()
        {
            base.setUp();
            ActivityInitialTouchMode = true;
            castActivity             = Activity;

            solo = new Solo(Instrumentation, castActivity);
            brightcoveVideoView = (BrightcoveVideoView)castActivity.findViewById(R.id.brightcove_video_view);
            eventEmitter        = brightcoveVideoView.EventEmitter;

//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final java.util.concurrent.CountDownLatch countDownLatch = new java.util.concurrent.CountDownLatch(2);
            CountDownLatch countDownLatch = new CountDownLatch(2);

            eventEmitter.once(EventType.DID_SET_VIDEO, new EventListenerAnonymousInnerClassHelper(this, countDownLatch));

            eventEmitter.once(EventType.DID_PLAY, new EventListenerAnonymousInnerClassHelper2(this, countDownLatch));

            assertTrue("Timeout occurred.", countDownLatch.@await(1, TimeUnit.MINUTES));
        }
Пример #9
0
        public override void Update()
        {
            int    firingInterval    = 2;
            int    mobFiringInterval = 2;
            string bulletType        = "BulletTypeA";

            if (FrameCount == 0)
            {
                foreach (MobileEntity mob in Mobs)
                {
                    mob.Position = new Vector2((-30 - 60 * Mobs.IndexOf(mob)), (-30 - 60 * Mobs.IndexOf(mob)));
                    mob.Active   = true;
                }
            }

            foreach (MobileEntity mob in Mobs)
            {
                if (FrameCount % (firingInterval * Constants.FPS) == 0)
                {
                    if (Mobs.IndexOf(mob) % mobFiringInterval == 0)
                    {
                        Solo formation = new Solo(new BulletMaker(), mob.Position);
                        Bullets.Add(MoveScriptMaker.CreateMoveScript(default, formation.SetFormation(bulletType), false));
Пример #10
0
 void Awake()
 {
     audioSource    = GetComponent <AudioSource>();
     soloFunc       = soloObj.GetComponent <Solo>();
     muteController = muteObj.GetComponent <Mute>();
 }
Пример #11
0
        public static void Initialize(CQLog log)
        {
            if (!File.Exists("config.json"))
            {
                FileStream   configFile = new FileStream("config.json", FileMode.OpenOrCreate);
                StreamReader reader     = new StreamReader(
                    System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("vip.popop.pcr.GHelper.Resources.default.json")
                    );
                StreamWriter writer      = new StreamWriter(configFile);
                string       defaultJson = reader.ReadToEnd();
                writer.Write(defaultJson);
                Config = JsonConvert.DeserializeObject <Configuration>(defaultJson);
                reader.Close();
                writer.Close();
                configFile.Close();
            }
            else
            {
                FileStream   configFileO  = new FileStream("config.json", FileMode.Open);
                StreamReader configReader = new StreamReader(configFileO);
                Config = JsonConvert.DeserializeObject <Configuration>(configReader.ReadToEnd());
                configReader.Close();
                configReader.Dispose();
                configFileO.Close();
            }

            Event_GroupMessage.ClearHandler();
            Event_PrivateMessage.ClearHandler();

            accountManager = new Account {
                logger = log
            };
            accountManager.OnInitialize();

            if (Config.IsPhonographEnabled)
            {
                phonograph = new Phonograph {
                    Client     = (Phonograph.ClientType)Enum.Parse(typeof(Phonograph.ClientType), Config.Phonograph.Platform),
                    IsWithLink = Config.Phonograph.WithLink
                };
                phonograph.OnInitialize();
            }

            if (Config.IsRepeaterEnabled)
            {
                repeater = new Repeater {
                    repeatChance = Config.Repeater.RepeatChance,
                    cooldown     = Config.Repeater.Cooldown,
                    banWords     = Config.Repeater.BanWords
                };
                repeater.OnInitialize();
            }

            if (Config.IsSleepHelperEnabled)
            {
                sleepHelper = new SleepHelper {
                };
                sleepHelper.OnInitialize();
            }

            if (Config.IsLinkGeneratorEnabled)
            {
                linkGenerator = new LinkGenerator {
                };
                linkGenerator.OnInitialize();
            }

            if (Config.IsSoloEnabled)
            {
                solo = new Solo {
                    validSpan = Config.Solo.ValidSpan,
                    checkTime = Config.Solo.CheckTime,
                    maxStack  = Config.Solo.MaxStack
                };
                solo.OnInitialize();
            }

            if (Config.IsForestEnabled)
            {
                forest = new Forest()
                {
                    Logger = log
                };
                forest.OnInitialize();
            }

            //letTheyOut = new LetThemOut {

            //};
            //letTheyOut.OnInitialize();
        }