Ejemplo n.º 1
0
    public bool Register(myUpdate update)
    {
        switch (update.GetUpdateType())
        {
        case myUpdate.UpdateType.GUI:
            GUIUpdates.Add(update.GetPriorityInType(), update);
            return(true);

        case myUpdate.UpdateType.Map:
            MapUpdates.Add(update.GetPriorityInType(), update);
            return(true);

        case myUpdate.UpdateType.PoolThing:
            //储存引用
            SortedList <int, myUpdate> temp;
            //看看有没有这个id
            if (PoolThingUpdates.TryGetValue(update.gameObject.GetInstanceID(), out temp))
            {
                //如果有,则将这个组件加入到对应敌人的更新队列中去
                temp.Add(update.GetPriorityInType(), update);
            }
            else
            {
                //如果没有,增加这个敌人的队列,并且把这个组件加入进去
                temp = new SortedList <int, myUpdate>();
                temp.Add(update.GetPriorityInType(), update);
                PoolThingUpdates.Add(update.gameObject.GetInstanceID(), temp);
            }

            return(true);

        case myUpdate.UpdateType.Player:
            PlayerUpdates.Add(update.GetPriorityInType(), update);
            return(true);

        case myUpdate.UpdateType.Enemy:
            //储存引用
            SortedList <int, myUpdate> temp1;
            //看看有没有这个id
            if (EnemyUpdates.TryGetValue(update.gameObject.GetInstanceID(), out temp1))
            {
                //如果有,则将这个组件加入到对应敌人的更新队列中去
                temp1.Add(update.GetPriorityInType(), update);
            }
            else
            {
                //如果没有,增加这个敌人的队列,并且把这个组件加入进去
                temp1 = new SortedList <int, myUpdate>();
                temp1.Add(update.GetPriorityInType(), update);
                EnemyUpdates.Add(update.gameObject.GetInstanceID(), temp1);
            }

            return(true);
        }
        return(false);
    }
Ejemplo n.º 2
0
 //Populate the script lists here.  Follow the example on how to add to a list
 #region Populate Tests
 /// <summary>
 /// Use this method to populate the lists.  They are already set to be selected from the
 /// CycleScripts method and no other work is required.
 /// </summary>
 public override void PopulateLists()
 {
     SignIn.Clear();
     AccountCreation.Clear();
     Registration.Clear();
     SoftwareUpdates.Clear();
     Navigation.Clear();
     MapUpdates.Clear();
     base.PopulateLists();
     //**below is a sample of how to add in a test.  Simply add in the name of the test in replace of Connect_SignIn
     //SignIn.Add(new Connect_SignIn(base.baseURL, base.webdriver, base.verificationErrors));
     // SignIn.Add(new prototype(base.baseURL, base.webdriver, base.verificationErrors));  //This Test was to investigate Selenium RC - Webdriver opted for due to usability/port setting issues/future support.
     Navigation.Add(new Buy_PurchaseTest(base.baseURL, base.webdriver, base.verificationErrors));
 }
Ejemplo n.º 3
0
 //Populate the script lists here.  Follow the example on how to add to a list
 #region Populate Tests
 /// <summary>
 /// Use this method to populate the lists.  They are already set to be selected from the
 /// CycleScripts method and no other work is required.
 /// </summary>
 public override void PopulateLists()
 {
     SignIn.Clear();
     AccountCreation.Clear();
     Tracker.Clear();
     Registration.Clear();
     SoftwareUpdates.Clear();
     Blackberry.Clear();
     MapUpdates.Clear();
     Navigation.Clear();
     base.PopulateLists();
     //**below is a sample of how to add in a test.  Simply add in the name of the test in replace of Connect_SignIn
     //SignIn.Add(new Connect_SignIn(base.baseURL, base.webdriver, base.verificationErrors));
     SignIn.Add(new MyGarmin_SignIn(base.baseURL, base.webdriver, base.verificationErrors));
 }