예제 #1
0
        /// <summary>
        /// Update the mouse manager.
        /// </summary>
        public override void Update(bool isActive)
        {
            //clear out the taps & touches
            Clicks.Clear();
            Highlights.Clear();
            Drags.Clear();
            Drops.Clear();
            Flicks.Clear();
            Pinches.Clear();

            if (null != Pinch)
            {
                //reset the pinch delta
                Pinch.Delta = 0f;
            }

            if (isActive)
            {
                TouchCollection = TouchPanel.GetState();

                //get the new taps & touches
                GetGestures();
                GetTouches();
            }

            //Add the pinch event if there is an ongoing gesture
            if (null != Pinch)
            {
                Pinches.Add(new PinchEventArgs(Pinch.Delta));
            }
        }
예제 #2
0
        protected override void Init()
        {
            Mobs.Clear();
            Drops.Clear();
            bStarted = false;
            bChaos   = MapId % 2 == 1;
            int nTimeLeftSec;

            switch (MapId)
            {
            case 240060000:                     // normal
                nTimeLeftSec = 60 * 60;         // 1 hour
                break;

            case 240060001:                     // chaos
                nTimeLeftSec = 120 * 60;        // 2 hours
                break;

            default:
                nTimeLeftSec = (int)ParentInstance.CFieldMan
                               .GetField(MapId - 100, nInstanceID)
                               .tFieldTimerExpiration
                               .SecondsUntilEnd() + 2;
                if (nTimeLeftSec < 0)
                {
                    nTimeLeftSec = 0;
                }

                break;
            }
            CreateFieldClock(nTimeLeftSec);

            base.Init();             // doesnt currently do anything but might in the future
        }
예제 #3
0
        /// <summary>
        /// Update the mouse manager.
        /// </summary>
        public override void Update(bool isActive)
        {
            //clear out the taps & touches
            Clicks.Clear();
            Highlights.Clear();
            Drags.Clear();
            Drops.Clear();
            Flicks.Clear();
            Pinches.Clear();
            Holds.Clear();

            if (null != Pinch)
            {
                //reset the pinch delta
                Pinch.Delta = 0f;
            }

            if (isActive && IsEnabled)
            {
                TouchCollection = TouchPanel.GetState();

                //get the new taps & touches
                GetGestures();
                GetTouches();
            }

            //Add the pinch event if there is an ongoing gesture
            if (null != Pinch)
            {
                if (Pinch.Finished)
                {
                    Pinches.Add(new PinchEventArgs(Pinch.First, Pinch.Second, Pinch.Delta)
                    {
                        Release = true
                    });
                    Pinch = null;
                }
                else
                {
                    Pinches.Add(new PinchEventArgs(Pinch.First, Pinch.Second, Pinch.Delta));
                }
            }
        }
예제 #4
0
 public void NewMap(string name)
 {
     map = new Map("./data/Maps/" + name + ".txt");
     foreach (var i in players)
     {
         map.AddPlayer(i.Key);
         players[i.Key].respawn();
     }
     Arrows.Clear();
     Drops.Clear();
     DropForRespawn.Clear();
     for (int i = 0; i < map.dropSpawners.Count; ++i)
     {
         int tag = Utily.GetTag();
         map.SpawnDrops(i, tag);
         Drops.Add(tag, new ADrop(map.dropSpawners[i].count, map.dropSpawners[i].id));
     }
     timer.Restart();
 }
예제 #5
0
        /// <summary>
        /// Clears all lower object pools and resets all higher object pools.
        /// Map can still be used after this is called.
        /// DO NOT CALL DISPOSE FROM INSIDE THIS FUNCTION
        /// </summary>
        protected virtual void Reset(bool bFromDispose = false)
        {
            if (Users.Count > 0)             // not good
            {
                throw new InvalidOperationException("Trying to reset map that still has users in it.");
            }

            QR = "";
            nFieldDeathCount      = -1;
            tFieldTimerExpiration = DateTime.MinValue;

            Mobs.Reset();
            Reactors.Reset();

            Drops.Clear();
            AffectedAreas.Clear();
            MiniRooms.Clear();
            Kites.Clear();
            TownPortals.Clear();
            OpenGates1.Clear();
            OpenGates2.Clear();
            CurrentWeather.Clear();
        }