コード例 #1
0
        private void _init()
        {
            _setUpSFML();

            m_DeltaTime    = 0.0;
            m_StepTime     = 1.0 / 60.0;
            m_MaxDeltaTime = 0.25; //0.25f
            m_Accumulator  = 0.0;
            m_Time         = 0.0;
            m_FPS          = 0.0;

            m_Timer = new cTimer();
            //ChangeGameState( new cGameScene(this) );

            fpsUpdater = new cRegulator();
            fpsUpdater.resetByPeriodTime(1.0f);


            //Idő szöveg
            timeText               = new Text("", cAssetManager.GetFont("pf_tempesta_seven"));
            timeText.Position      = new Vector2f(this.defaultView.Size.X - 500, 30);
            timeText.CharacterSize = 28; // in pixels, not points!
            timeText.Color         = Color.White;
            timeText.Style         = Text.Styles.Bold;

            cGlobalClock.Start();

            m_CurrentState = new cGameScene(this);
            m_CurrentState.Enter();

            m_AppRunning = true;
        }
コード例 #2
0
        public override void Stop(IDataInput input)
        {
            if (_Timers != null)
            {
                _Timers.Stop();
                _Timers.Dispose();
                _Timers = null;
            }

            base.Stop(input);
        }
コード例 #3
0
        public override void Start(IDataInput input)
        {
            if (_Timers != null)
            {
                return;
            }

            // Creación del timer
            _Timers          = new cTimer();
            _Timers.Parent   = input;
            _Timers.Interval = IntervalInMilliseconds;
            _Timers.Elapsed += Timer_Elapsed;

            _Timers.Start();

            base.Start(input);
        }
コード例 #4
0
        public cMonster(cGameScene scene, Vector2f pos) : base(scene, pos)
        {
            p_followLight                 = new cLight();
            p_followLight.Radius          = 80.0f;
            p_followLight.LinearizeFactor = 0.9f;
            p_followLight.Bleed           = 2.0f;
            p_followLight.Color           = new Color(20, 184, 87);
            //this.Scene.LightMap.AddStaticLight(p_followLight);


            eye                 = new cLight();
            eye.Radius          = 10.0f;
            eye.LinearizeFactor = 0.98f;
            eye.Bleed           = 5.0f;
            eye.OriginalColor   = new Color(255, 39, 13);
            eye.Color           = new Color(255, 39, 13);

            this.Scene.LightMap.AddStaticLight(eye);

            locateTime = new cTimer();
        }
コード例 #5
0
        public override void Run()
        {
            if (Calls.MovementIsOnly(0x0))
            {
                if (!locationSaved)
                {
                    curPoint      = new Objects.Location(ObjectManager.PlayerObject.Pos.x, ObjectManager.PlayerObject.Pos.y, ObjectManager.PlayerObject.Pos.z);
                    locationSaved = true;
                    IsVendoring   = true;
                    failCounter   = 0;
                    failCounter2  = 0;
                }
                else
                {
                    if (Data.VendorLocation.differenceToPlayer() > 2)
                    {
                        if (ObjectManager.playerClass == (uint)Constants.Offsets.classIds.Warlock || ObjectManager.playerClass == (uint)Constants.Offsets.classIds.Hunter)
                        {
                            if (Ingame.GotPet())
                            {
                                Ingame.DismissPet();
                            }
                            else
                            {
                                Ingame.Tele(Data.VendorLocation, 60, false);
                            }
                        }
                        else
                        {
                            Ingame.Tele(Data.VendorLocation, 60, false);
                        }
                    }
                    else
                    {
                        if (ObjectManager.playerClass == (byte)Constants.Offsets.classIds.Druid)
                        {
                            SpellManager.CheckSpells();
                            if (Ingame.druidIsBear())
                            {
                                Ingame.Cast("Bear Form", false);
                            }
                            if (Ingame.druidIsCat())
                            {
                                Ingame.Cast("Cat Form", false);
                            }
                            Ingame.CastFinal();
                        }

                        if (Ingame.IsVendorFrameOpen())
                        {
                            Ingame.SellAllBut(Data.ProtectedItems);

                            cTimer waitTimer = new cTimer(1000);
                            while (!waitTimer.IsReady())
                            {
                                Thread.CurrentThread.Join(100);
                            }
                            failCounter2 = failCounter2 + 1;

                            if (Data.gotVendor && ObjectManager.FreeBagSlots <= Data.LeaveFreeSlots)
                            {
                                if (failCounter2 >= 20)
                                {
                                    GoBack();
                                }
                            }
                            else
                            {
                                GoBack();
                            }
                        }
                        else
                        {
                            Objects.UnitObject tmpObj = ObjectManager.GetUnitByName(Data.VendorName);
                            if (tmpObj.baseAdd != 0)
                            {
                                Calls.OnRightClickUnit(tmpObj.baseAdd, 1);
                            }
                            else
                            {
                                failCounter = failCounter + 1;
                            }

                            cTimer waitTimer = new cTimer(1000);
                            while (!waitTimer.IsReady())
                            {
                                Thread.CurrentThread.Join(100);
                            }

                            if (failCounter >= 6)
                            {
                                GoBack();
                            }
                        }
                    }
                }
            }
            else
            {
                Calls.StopRunning();
            }
        }
コード例 #6
0
ファイル: Spell.cs プロジェクト: ynyzyfy/WowOldBot
 internal Spell(string name, int sleepTime)
 {
     wait = new cTimer(sleepTime);
     Name = name;
 }
コード例 #7
0
ファイル: CPU.Timers.cs プロジェクト: DenSinH/GBAC-
 public cTimer(ARM7TDMI cpu, Scheduler.Scheduler scheduler, int index, cTimer Next) : this(cpu, scheduler, index)
 {
     this.Next = Next;
 }
コード例 #8
0
ファイル: stateAssistDc.cs プロジェクト: ynyzyfy/WowOldBot
        public override void Run()
        {
            if (firstBool)
            {
                tmpTimer = new cTimer(10000);
                while (!tmpTimer.IsReady() && ObjectManager.playerPtr == 0)
                {
                    Thread.CurrentThread.Join(100);
                }

                Ingame.BackToLogin();
                tmpTimer = new cTimer(10000);
                while (!tmpTimer.IsReady() && ObjectManager.playerPtr == 0)
                {
                    Thread.CurrentThread.Join(100);
                }
                firstBool = false;
                failTrys  = 0;
            }

            if (Ingame.IsDc())
            {
                if (ObjectManager.LoginState == "login")
                {
                    Calls.DoString("DefaultServerLogin('" + Data.AccName + "', '" + Data.AccPw + "');");

                    tmpTimer = new cTimer(600000);
                    while (!tmpTimer.IsReady() && ObjectManager.playerPtr == 0 && ObjectManager.LoginState == "login")
                    {
                        Thread.CurrentThread.Join(100);
                    }
                    failTrys = failTrys + 1;

                    if (failTrys >= 2)
                    {
                        firstBool = true;
                    }
                }

                if (ObjectManager.LoginState == "charselect")
                {
                    Calls.DoString("EnterWorld();");
                    EnterWorldTimer.Reset();
                    while (!EnterWorldTimer.IsReady() && ObjectManager.playerPtr == 0)
                    {
                        Thread.CurrentThread.Join(100);
                    }
                }
                gotDc = true;
            }
            else
            {
                if (ObjectManager.playerPtr != 0)
                {
                    Thread.CurrentThread.Join(3000);
                    Calls.SetMovementFlags(0);
                    gotDc     = false;
                    firstBool = true;
                    ObjectManager.ExecuteOnce = true;
                    ChatReader.ClearChat      = true;
                }
            }
        }
コード例 #9
0
 public cGameScene(cSfmlApp controller) : base(controller)
 {
     levelTimer = new cTimer();
 }
コード例 #10
0
ファイル: cGlobalClock.cs プロジェクト: masums/platformerGame
 /*private cGlobalClock() { }*/
 static cGlobalClock()
 {
     timer = new cTimer();
 }
コード例 #11
0
ファイル: Spell.cs プロジェクト: acidburn974/CorthezzWoWBot
 internal Spell(string name, int sleepTime)
 {
     wait = new cTimer(sleepTime);
     Name = name;
 }