Beispiel #1
0
        public AddForm(string buttonText, EnumAction buttonAction, Form1 form) : this()
        {
            CreateButton.Text = buttonText;
            MotherForm        = form;
            switch (buttonAction)
            {
            case EnumAction.Add:
                ButtonAction = StandartAction;
                break;

            case EnumAction.Update:
                ButtonAction = EditAction;
                User target;
                using (ModelOfShop db = new ModelOfShop())
                {
                    target = db.Users.Find(int.Parse(MotherForm.DataBaseGrid[0, MotherForm.DataBaseGrid.SelectedRows[0].Index].Value.ToString()));
                }
                NameField.Text                 = target.FirsName;
                LastNameField.Text             = target.LastName;
                MiddleNameField.Text           = target.MiddleName;
                LoginField.Text                = target.Login;
                PasswordField.Text             = target.Password;
                CheckAdmin.Checked             = (bool)target.IsAdmin;
                NumberField.Text               = target.Phone.ToString();
                CountryCodeField.SelectedIndex = (int)target.CountryCode;
                break;
            }
            CheckStats(this, null);
        }
Beispiel #2
0
 public CowMessage(EnumAction action, Guid sender, Payload payload, Guid?target = null)
 {
     Action  = action;
     Sender  = sender;
     Payload = payload;
     Target  = target;
 }
Beispiel #3
0
 private void ChooseSpecial()
 {
     if (CurGem == EnumGem.NONE || Dead)
     {
         return;
     }
     else if (CurGem == EnumGem.AIR)
     {
         if (IsDirectionAdjacent(QueuedActionDirection, EnumDir.S) && DivekickCharged)
         {
             StartAction("DiveKick");
             QueuedAction = EnumAction.NONE;
         }
         else if (!IsDirectionAdjacent(QueuedActionDirection, EnumDir.S) && FlyAttackCharged)
         {
             StartAction("Fly");
             QueuedAction = EnumAction.NONE;
         }
     }
     else if (CurGem == EnumGem.ZAP)
     {
         StartAction("Laser");
         QueuedAction = EnumAction.NONE;
     }
 }
        public virtual void DoRenderPlayer(EntityPlayer par1EntityPlayer, double par2, double par4, double par6, float par8, float par9)
        {
            ItemStack itemstack = par1EntityPlayer.Inventory.GetCurrentItem();

            ModelArmorChestplate.HeldItemRight = ModelArmor.HeldItemRight = ModelBipedMain.HeldItemRight = itemstack == null ? 0 : 1;

            if (itemstack != null && par1EntityPlayer.GetItemInUseCount() > 0)
            {
                EnumAction enumaction = itemstack.GetItemUseAction();

                if (enumaction == EnumAction.Block)
                {
                    ModelArmorChestplate.HeldItemRight = ModelArmor.HeldItemRight = ModelBipedMain.HeldItemRight = 3;
                }
                else if (enumaction == EnumAction.Bow)
                {
                    ModelArmorChestplate.AimedBow = ModelArmor.AimedBow = ModelBipedMain.AimedBow = true;
                }
            }

            ModelArmorChestplate.IsSneak = ModelArmor.IsSneak = ModelBipedMain.IsSneak = par1EntityPlayer.IsSneaking();
            double d = par4 - (double)par1EntityPlayer.YOffset;

            if (par1EntityPlayer.IsSneaking() && !(par1EntityPlayer is EntityPlayerSP))
            {
                d -= 0.125D;
            }

            base.DoRenderLiving(par1EntityPlayer, par2, d, par6, par8, par9);
            ModelArmorChestplate.AimedBow      = ModelArmor.AimedBow = ModelBipedMain.AimedBow = false;
            ModelArmorChestplate.IsSneak       = ModelArmor.IsSneak = ModelBipedMain.IsSneak = false;
            ModelArmorChestplate.HeldItemRight = ModelArmor.HeldItemRight = ModelBipedMain.HeldItemRight = 0;
        }
Beispiel #5
0
        static void Main(string[] args)
        {
            while (CurrAction != EnumAction.Exit)
            {
                switch (CurrAction)
                {
                case EnumAction.Start:
                    CurrAction = Start();
                    break;

                case EnumAction.Login:
                    CurrAction = Login();
                    break;

                case EnumAction.Get:
                    CurrAction = OpenFavorite();
                    break;

                case EnumAction.Idle:
                    CurrAction = GetUserAction();
                    break;

                default:
                    break;
                }
            }
            Driver.Quit();
            Environment.Exit(0);
        }
 public frmGuestsGroups(int GroupID, int GuestID, int GuestIDToAdd, DateTime Date, EnumAction EnumAct)
 {
     InitializeComponent();
     _groupID      = GroupID;
     _guestID      = GuestID;
     _guestIDToAdd = GuestIDToAdd;
     _date         = Date;
     _enumAction   = EnumAct;
 }
Beispiel #7
0
        DogAction getAction(string name, out EnumAction enumAction)
        {
            var x = dogActions.FirstOrDefault(r => r.Name == name);

            enumAction = EnumAction.e未知;
            if (x != null)
            {
                Enum.TryParse <EnumAction>("e" + name, out enumAction);
            }
            return(x);
        }
Beispiel #8
0
        public FormCRUDAppartenir(CRUD Parent, int id = -1)
        {
            InitializeComponent();
            this.Parent = Parent;
            Controleur.Vmodele.charger_donnees("classes");
            if (Controleur.Vmodele.Chargement)
            {
                for (int i = 0; i < Controleur.Vmodele.DT[2].Rows.Count; i++)
                {
                    cb_classesAppartenir.Items.Add(new cbItem(Controleur.Vmodele.DT[2].Rows[i][1].ToString(), Controleur.Vmodele.DT[2].Rows[i][0].ToString()));
                }
            }
            Controleur.Vmodele.charger_donnees("etudiants");
            if (Controleur.Vmodele.Chargement)
            {
                for (int i = 0; i < Controleur.Vmodele.DT[14].Rows.Count; i++)
                {
                    cb_etudiantsAppartenir.Items.Add(new cbItem(Controleur.Vmodele.DT[14].Rows[i][1].ToString(), Controleur.Vmodele.DT[14].Rows[i][0].ToString()));
                }
            }


            if (id == -1)
            {
                actionForm = EnumAction.Ajout;
            }
            else
            {
                actionForm = EnumAction.Modification;
                this.id    = id;
                //charger combo
                for (int i = 0; i < Controleur.Vmodele.DT[14].Rows.Count; i++)
                {
                    if (Controleur.Vmodele.DT[14].Rows[i][0].ToString() == Controleur.Vmodele.DT[1].Rows[id][1].ToString())
                    {
                        cb_etudiantsAppartenir.SelectedIndex = i;
                    }
                }
                for (int i = 0; i < Controleur.Vmodele.DT[2].Rows.Count; i++)
                {
                    if (Controleur.Vmodele.DT[2].Rows[i][0].ToString() == Controleur.Vmodele.DT[1].Rows[id][0].ToString())
                    {
                        cb_classesAppartenir.SelectedIndex = i;
                    }
                }


                tb_anneeApartenir.Text = (Controleur.Vmodele.DT[1].Rows[id][2].ToString());
            }
            this.Show();
        }
Beispiel #9
0
        public void ShowAlter(string msg, EnumType type)
        {
            this.Opacity       = 0.0;
            this.StartPosition = FormStartPosition.Manual;
            string fname;

            for (int i = 1; i < 10; i++)
            {
                fname = "alter " + i.ToString();
                Form_Alter frm = (Form_Alter)Application.OpenForms[fname];
                if (frm == null)
                {
                    this.Name     = fname;
                    this.x        = Screen.PrimaryScreen.WorkingArea.Width - this.Width + 15;
                    this.y        = Screen.PrimaryScreen.WorkingArea.Height - this.Height * i - 5 * i;
                    this.Location = new Point(this.x, this.y);
                    break;
                }
            }
            this.x = Screen.PrimaryScreen.WorkingArea.Width - base.Width - 5;

            switch (type)
            {
            case EnumType.Success:
                this.pictureBox1.Image = Resources.success;
                this.BackColor         = Color.SeaGreen;
                break;

            case EnumType.Error:
                this.pictureBox1.Image = Resources.error;
                this.BackColor         = Color.DarkRed;
                break;

            case EnumType.Info:
                this.pictureBox1.Image = Resources.info;
                this.BackColor         = Color.RoyalBlue;
                break;

            case EnumType.Warning:
                this.pictureBox1.Image = Resources.warning;
                this.BackColor         = Color.DarkOrange;
                break;
            }

            this.lbMessage.Text = msg;
            this.Show();
            this.action          = EnumAction.Start;
            this.timer1.Interval = 1;
            this.timer1.Start();
        }
Beispiel #10
0
        public string ConditionToSearchItem(int pintCCNID, EnumAction enumAction)
        {
            string strCondition = " WHERE " + v_ITMBOM_Product.VIEW_NAME + "." + ITM_ProductTable.CCNID_FLD + " = " + pintCCNID.ToString() + " and " + v_ITMBOM_Product.VIEW_NAME + "." + ITM_ProductTable.MAKEITEM_FLD + " = 1 and "
                                  + v_ITMBOM_Product.VIEW_NAME + "." + v_ITMBOM_Product.HASBOM_FLD + " = ";

            if (enumAction == EnumAction.Add)
            {
                strCondition += "0";
            }
            else
            {
                strCondition += "1";
            }
            return(strCondition);
        }
 public FormCRUDCommentaires(CRUD Parent, int id = -1)
 {
     InitializeComponent();
     this.Parent = Parent;
     Controleur.Vmodele.charger_donnees("etudiants");
     if (Controleur.Vmodele.Chargement)
     {
         for (int i = 0; i < Controleur.Vmodele.DT[14].Rows.Count; i++)
         {
             cb_Etudiants.Items.Add(new cbItem(Controleur.Vmodele.DT[14].Rows[i][4].ToString(), Controleur.Vmodele.DT[14].Rows[i][0].ToString()));
         }
     }
     Controleur.Vmodele.charger_donnees("logements");
     if (Controleur.Vmodele.Chargement)
     {
         for (int i = 0; i < Controleur.Vmodele.DT[8].Rows.Count; i++)
         {
             cb_Logements.Items.Add(new cbItem(Controleur.Vmodele.DT[8].Rows[i][1].ToString(), Controleur.Vmodele.DT[8].Rows[i][0].ToString()));
         }
     }
     if (id == -1)
     {
         actionForm = EnumAction.Ajout;
     }
     else
     {
         actionForm = EnumAction.Modification;
         this.id    = id;
         for (int i = 0; i < Controleur.Vmodele.DT[14].Rows.Count; i++)
         {
             if (Controleur.Vmodele.DT[14].Rows[i][0].ToString() == Controleur.Vmodele.DT[3].Rows[id][1].ToString())
             {
                 cb_Etudiants.SelectedIndex = i;
             }
         }
         for (int i = 0; i < Controleur.Vmodele.DT[8].Rows.Count; i++)
         {
             if (Controleur.Vmodele.DT[8].Rows[i][0].ToString() == Controleur.Vmodele.DT[3].Rows[id][0].ToString())
             {
                 cb_Logements.SelectedIndex = i;
             }
         }
         dp_Date.Text = Controleur.Vmodele.DT[3].Rows[id][2].ToString();
         tb_Note.Text = (Controleur.Vmodele.DT[3].Rows[id][3].ToString());
     }
     this.Show();
 }
Beispiel #12
0
 public FormCRUDComposent(CRUD Parent, int id = -1)
 {
     InitializeComponent();
     this.Parent = Parent;
     Controleur.Vmodele.charger_donnees("equipements");
     if (Controleur.Vmodele.Chargement)
     {
         for (int i = 0; i < Controleur.Vmodele.DT[7].Rows.Count; i++)
         {
             cbEquipement.Items.Add(new cbItem(Controleur.Vmodele.DT[7].Rows[i][1].ToString(), Controleur.Vmodele.DT[7].Rows[i][0].ToString()));
         }
     }
     Controleur.Vmodele.charger_donnees("logements");
     if (Controleur.Vmodele.Chargement)
     {
         for (int i = 0; i < Controleur.Vmodele.DT[8].Rows.Count; i++)
         {
             cbLogement.Items.Add(new cbItem(Controleur.Vmodele.DT[8].Rows[i][1].ToString(), Controleur.Vmodele.DT[8].Rows[i][0].ToString()));
         }
     }
     if (id == -1)
     {
         actionForm = EnumAction.Ajout;
     }
     else
     {
         actionForm = EnumAction.Modification;
         this.id    = id;
         for (int i = 0; i < Controleur.Vmodele.DT[7].Rows.Count; i++)
         {
             if (Controleur.Vmodele.DT[7].Rows[i][0].ToString() == Controleur.Vmodele.DT[4].Rows[id][0].ToString())
             {
                 cbEquipement.SelectedIndex = i;
             }
         }
         for (int i = 0; i < Controleur.Vmodele.DT[8].Rows.Count; i++)
         {
             if (Controleur.Vmodele.DT[8].Rows[i][0].ToString() == Controleur.Vmodele.DT[4].Rows[id][1].ToString())
             {
                 cbLogement.SelectedIndex = i;
             }
         }
     }
     this.Show();
 }
 public FormCRUDProprio(CRUD Parent, int id = -1)
 {
     InitializeComponent();
     this.Parent = Parent;
     Controleur.Vmodele.charger_donnees("personnes");
     ChargerListeDerou();
     if (id == -1)
     {
         actionForm = EnumAction.Ajout;
     }
     else
     {
         actionForm = EnumAction.Modification;
         this.id    = id;
         ChargerInfoProprio(id);
     }
     this.Show();
 }
Beispiel #14
0
        public FormCRUDEquipements(CRUD Parent, int id = -1)
        {
            InitializeComponent();
            this.Parent = Parent;

            if (id == -1)
            {
                actionForm = EnumAction.Ajout;
            }
            else
            {
                actionForm = EnumAction.Modification;
                this.id    = id;
                tb_libelleEquipements.Text = (Controleur.Vmodele.DT[7].Rows[id][1].ToString());
            }

            this.Show();
        }
Beispiel #15
0
 /// <summary>
 /// 启动指定方法
 /// </summary>
 public void Completed()
 {
     try
     {
         if (typeof(EnClient) == EnumAction.GetType())
         {
             ((Action <string, EnClient, DateTime>)EnCompleted)?.Invoke(Key, (EnClient)EnumAction, Time);
         }
         else if (typeof(EnServer) == EnumAction.GetType())
         {
             ((Action <string, EnServer, DateTime>)EnCompleted)?.Invoke(Key, (EnServer)EnumAction, Time);
         }
     }
     catch (Exception e)
     {
         Log.Error("TCP事件调用异常", e);
     }
 }
Beispiel #16
0
        public static string GetSpeech(EnumAction a, EnumLevel l)
        {
            List <string> speech = new List <string>();
            int           i      = 0;

            foreach (var item in ParseJSON.Instance.dialog)
            {
                if (item.Action == Enum.GetName(typeof(EnumAction), a) &&
                    item.Level == Enum.GetName(typeof(EnumLevel), l))
                {
                    speech.Add(item.Speech);
                    i++;
                }
            }

            Random r     = new Random();
            int    index = r.Next(speech.Count);

            return(speech[index]);
        }
Beispiel #17
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            switch (this.action)
            {
            case EnumAction.Wait:
                timer1.Interval = 5000;
                action          = EnumAction.Close;
                break;

            case EnumAction.Start:
                timer1.Interval = 1;
                this.Opacity   += 0.1;
                if (this.x < this.Location.X)
                {
                    this.Left--;
                }
                else
                {
                    if (this.Opacity == 1.0)
                    {
                        action = EnumAction.Wait;
                    }
                }
                break;

            case EnumAction.Close:
                timer1.Interval = 1;
                this.Opacity   -= 0.1;
                this.Left      -= 3;
                if (base.Opacity == 0.0)
                {
                    base.Close();
                }
                break;
            }
        }
        public NomUniqueAttribute(string modele, string cherche, string chercheint, EnumAction action)
        {
            _action     = action;
            _modele     = modele;
            _cherche    = cherche;
            _chercheint = chercheint;

            switch (_modele)
            {
            case "Utilisateur":
                ErrorMessage = Phrase.LoginExiste();

                break;

            case "Theme":
                ErrorMessage = Phrase.TitreExiste();
                break;

            default:
                ErrorMessage = Phrase.NomExiste();
                break;
            }
            /*ErrorMessage = "Existe déjà...";*/
        }
        private static void ActionPropertyChanged(BindableObject bindable, object oldValue, object newValue)
        {
            var thisItem = (CardGraphicsXF)bindable;

            thisItem.MainObject !.Action = (EnumAction)newValue;
        }
Beispiel #20
0
    //******************************************************************************************
    //									FIXED UPDATE
    //******************************************************************************************


    void FixedUpdate()
    {
        //Complete the queued action, if possible.
        if (!Attacking && Time.time - QueuedActionTime < MaxQueueTime && !Dead)
        {
            //Complete the queued action
            //If an action is completed, make sure to make the QueuedAction NONE so that the action doesn't happen again.

            if (QueuedAction == EnumAction.JUMP && IsGrounded())
            {
                //JUMP
                //Debug.Log("Jumping");
                Jump();
                QueuedAction = EnumAction.NONE;
            }
            else if (QueuedAction == EnumAction.BASIC_ATTACK)
            {
                //Basic attack
                //Debug.Log("Basic Attack");
                if (QueuedActionDirection == EnumDir.E || QueuedActionDirection == EnumDir.NE || QueuedActionDirection == EnumDir.SE)
                {
                    SetFacingRight(true);
                }
                else if (QueuedActionDirection == EnumDir.W || QueuedActionDirection == EnumDir.NW || QueuedActionDirection == EnumDir.SW)
                {
                    SetFacingRight(false);
                }

                StartAction("Punch");
                QueuedAction = EnumAction.NONE;
            }
            else if (QueuedAction == EnumAction.SPECIAL_ATTACK)
            {
                if (QueuedActionDirection == EnumDir.E || QueuedActionDirection == EnumDir.NE || QueuedActionDirection == EnumDir.SE)
                {
                    SetFacingRight(true);
                }
                else if (QueuedActionDirection == EnumDir.W || QueuedActionDirection == EnumDir.NW || QueuedActionDirection == EnumDir.SW)
                {
                    SetFacingRight(false);
                }

                //Special Attack
                ChooseSpecial();
            }
            else if (QueuedAction == EnumAction.PICKUP)
            {
                PickupGem();
            }
        }

        //Do state transitions!
        UpdateGroundState();
        //Debug.Log(WasOnGround() + " -> " + IsGrounded());


        //Now that we have completed the action queue, do movement!
        float accelX = 0;
        float accelY = 0;

        if (IsGrounded())
        {
            float targetXVel = Horizontal * MaxSpeed;
            if (Attacking)
            {
                targetXVel = 0;
            }
            float dv = targetXVel - rb.velocity.x;
            accelX = dv / Time.fixedDeltaTime;

            if (accelX > GroundAccel)
            {
                accelX = GroundAccel;
            }
            else if (accelX < -GroundAccel)
            {
                accelX = -GroundAccel;
            }
        }
        else if (!IsGrounded())
        {
            float dv = Horizontal * AirAccel * Time.fixedDeltaTime;
            if (Attacking)
            {
                dv = 0;
            }

            if (Horizontal > 0 && dv + rb.velocity.x > MaxSpeed)
            {
                dv = Mathf.Max(0, MaxSpeed - rb.velocity.x);
            }
            else if (Horizontal < 0 && dv + rb.velocity.x < -MaxSpeed)
            {
                dv = Mathf.Min(0, -MaxSpeed - rb.velocity.x);
            }

            accelX = dv / Time.fixedDeltaTime;

            //cancel jump if they let go
            if (rb.velocity.y > 0 && (!heldJump || !floating) && !Attacking && !forceFloating)
            {
                floating = false;
                float dvy = -JumpCancelAccel * Time.fixedDeltaTime;
                if (-dvy > rb.velocity.y)
                {
                    dv = -rb.velocity.y;
                }

                accelY = dvy / Time.fixedDeltaTime;
            }
        }

        rb.AddForce(new Vector2(accelX * rb.mass, accelY * rb.mass), ForceMode2D.Force);

        //Update ground variables!
        GroundFrameEnd();

        //Update input average count
        NumInputsStored = 0;
    }
Beispiel #21
0
    // Update is called once per frame
    void Update()
    {
        //UPDATE INPUTS
        //UPDATE THESE TO AVERAGE OVER MULTIPLE FRAMES
        float RawHorz = Input.GetAxisRaw("Horizontal");
        float RawVert = Input.GetAxisRaw("Vertical");

        if (Dead)
        {
            Horizontal = 0;
            Vertical   = 0;
        }
        else if (NumInputsStored == 0)
        {
            Horizontal = RawHorz;
            Vertical   = RawVert;
        }
        else
        {
            Horizontal = (NumInputsStored * Horizontal + RawHorz) / (NumInputsStored + 1);
            Vertical   = (NumInputsStored * Vertical + RawVert) / (NumInputsStored + 1);
        }
        NumInputsStored++;
        heldJump = Input.GetButton("Jump");

        //UPDATE ACTION BASED INPUTS
        if (Input.GetButtonDown("Jump"))
        {
            QueuedAction     = EnumAction.JUMP;
            QueuedActionTime = Time.time;
        }
        else if (Input.GetButtonDown("Attack"))
        {
            QueuedAction          = EnumAction.BASIC_ATTACK;
            QueuedActionDirection = GetDirection(RawHorz, RawVert);
            QueuedActionTime      = Time.time;
        }
        else if (Input.GetButtonDown("Special"))
        {
            QueuedAction          = EnumAction.SPECIAL_ATTACK;
            QueuedActionDirection = GetDirection(RawHorz, RawVert);
            QueuedActionTime      = Time.time;
        }
        else if (Input.GetButtonDown("Pickup"))
        {
            QueuedAction          = EnumAction.PICKUP;
            QueuedActionDirection = GetDirection(RawHorz, RawVert);
            QueuedActionTime      = Time.time;
        }



        if (Horizontal > 0 && !GetFacingRight() && rb.velocity.x > 0 && !Attacking)
        {
            SetFacingRight(true);
        }
        else if (Horizontal < 0 && GetFacingRight() && rb.velocity.x < 0 && !Attacking)
        {
            SetFacingRight(false);
        }

        if (Horizontal == 0f && (rb.velocity.x < 0.01f && rb.velocity.x > -0.01f))        //player standing still
        {
            //set state to idle
            anim.SetInteger("Accel", 0);
        }
        else if (rb.velocity.x * Horizontal > 0)         //player is accelerating,
        {
            //set state to running
            anim.SetInteger("Accel", 1);
        }
        else         //Player is deccelerating
        {
            //set state to sliding
            anim.SetInteger("Accel", -1);
        }

        anim.SetBool("Falling", rb.velocity.y < 0);
    }
Beispiel #22
0
        /// <summary>
        /// Renders the active item in the player's hand when in first person mode. Args: partialTickTime
        /// </summary>
        public virtual void RenderItemInFirstPerson(float par1)
        {
            float          f = PrevEquippedProgress + (EquippedProgress - PrevEquippedProgress) * par1;
            EntityPlayerSP entityplayersp = Mc.ThePlayer;
            float          f1             = ((EntityPlayer)(entityplayersp)).PrevRotationPitch + (((EntityPlayer)(entityplayersp)).RotationPitch - ((EntityPlayer)(entityplayersp)).PrevRotationPitch) * par1;

            //GL.PushMatrix();
            //GL.Rotate(f1, 1.0F, 0.0F, 0.0F);
            //GL.Rotate(((EntityPlayer)(entityplayersp)).PrevRotationYaw + (((EntityPlayer)(entityplayersp)).RotationYaw - ((EntityPlayer)(entityplayersp)).PrevRotationYaw) * par1, 0.0F, 1.0F, 0.0F);
            RenderHelper.EnableStandardItemLighting();
            //GL.PopMatrix();

            if (entityplayersp is EntityPlayerSP)
            {
                EntityPlayerSP entityplayersp1 = (EntityPlayerSP)entityplayersp;
                float          f2 = entityplayersp1.PrevRenderArmPitch + (entityplayersp1.RenderArmPitch - entityplayersp1.PrevRenderArmPitch) * par1;
                float          f4 = entityplayersp1.PrevRenderArmYaw + (entityplayersp1.RenderArmYaw - entityplayersp1.PrevRenderArmYaw) * par1;
                //GL.Rotate((((EntityPlayer)(entityplayersp)).RotationPitch - f2) * 0.1F, 1.0F, 0.0F, 0.0F);
                //GL.Rotate((((EntityPlayer)(entityplayersp)).RotationYaw - f4) * 0.1F, 0.0F, 1.0F, 0.0F);
            }

            ItemStack itemstack = ItemToRender;
            float     f3        = Mc.TheWorld.GetLightBrightness(MathHelper2.Floor_double(((EntityPlayer)(entityplayersp)).PosX), MathHelper2.Floor_double(((EntityPlayer)(entityplayersp)).PosY), MathHelper2.Floor_double(((EntityPlayer)(entityplayersp)).PosZ));

            f3 = 1.0F;
            int i = Mc.TheWorld.GetLightBrightnessForSkyBlocks(MathHelper2.Floor_double(((EntityPlayer)(entityplayersp)).PosX), MathHelper2.Floor_double(((EntityPlayer)(entityplayersp)).PosY), MathHelper2.Floor_double(((EntityPlayer)(entityplayersp)).PosZ), 0);
            int k = i % 0x10000;
            int l = i / 0x10000;

            OpenGlHelper.SetLightmapTextureCoords(OpenGlHelper.LightmapTexUnit, (float)k / 1.0F, (float)l / 1.0F);
            //GL.Color4(1.0F, 1.0F, 1.0F, 1.0F);

            if (itemstack != null)
            {
                int   j   = Item.ItemsList[itemstack.ItemID].GetColorFromDamage(itemstack.GetItemDamage(), 0);
                float f8  = (float)(j >> 16 & 0xff) / 255F;
                float f13 = (float)(j >> 8 & 0xff) / 255F;
                float f19 = (float)(j & 0xff) / 255F;
                //GL.Color4(f3 * f8, f3 * f13, f3 * f19, 1.0F);
            }
            else
            {
                //GL.Color4(f3, f3, f3, 1.0F);
            }

            if (itemstack != null && itemstack.ItemID == Item.Map.ShiftedIndex)
            {
                //GL.PushMatrix();
                //	float f5 = 0.8F;
                float f9  = entityplayersp.GetSwingProgress(par1);
                float f14 = MathHelper2.Sin(f9 * (float)Math.PI);
                float f20 = MathHelper2.Sin(MathHelper2.Sqrt_float(f9) * (float)Math.PI);
                //GL.Translate(-f20 * 0.4F, MathHelper.Sin(MathHelper.Sqrt_float(f9) * (float)Math.PI * 2.0F) * 0.2F, -f14 * 0.2F);
                f9 = (1.0F - f1 / 45F) + 0.1F;

                if (f9 < 0.0F)
                {
                    f9 = 0.0F;
                }

                if (f9 > 1.0F)
                {
                    f9 = 1.0F;
                }

                f9 = -MathHelper2.Cos(f9 * (float)Math.PI) * 0.5F + 0.5F;
                //GL.Translate(0.0F, (0.0F * f5 - (1.0F - f) * 1.2F - f9 * 0.5F) + 0.04F, -0.9F * f5);
                //GL.Rotate(90F, 0.0F, 1.0F, 0.0F);
                //GL.Rotate(f9 * -85F, 0.0F, 0.0F, 1.0F);
                //GL.Enable(EnableCap.RescaleNormal);
                //GL.BindTexture(TextureTarget.Texture2D, Mc.RenderEngineOld.GetTextureForDownloadableImage(Mc.ThePlayer.SkinUrl, Mc.ThePlayer.GetTexture()));

                for (f14 = 0; f14 < 2; f14++)
                {
                    f20 = f14 * 2 - 1;
                    //GL.PushMatrix();
                    //GL.Translate(-0F, -0.6F, 1.1F * (float)f20);
                    //GL.Rotate(-45 * f20, 1.0F, 0.0F, 0.0F);
                    //GL.Rotate(-90F, 0.0F, 0.0F, 1.0F);
                    //GL.Rotate(59F, 0.0F, 0.0F, 1.0F);
                    //GL.Rotate(-65 * f20, 0.0F, 1.0F, 0.0F);
                    Render       render1       = RenderManager.Instance.GetEntityRenderObject(Mc.ThePlayer);
                    RenderPlayer renderplayer1 = (RenderPlayer)render1;
                    //	float f34 = 1.0F;
                    //GL.Scale(f34, f34, f34);
                    renderplayer1.DrawFirstPersonHand();
                    //GL.PopMatrix();
                }

                f14 = entityplayersp.GetSwingProgress(par1);
                f20 = MathHelper2.Sin(f14 * f14 * (float)Math.PI);
                float f27 = MathHelper2.Sin(MathHelper2.Sqrt_float(f14) * (float)Math.PI);
                //GL.Rotate(-f20 * 20F, 0.0F, 1.0F, 0.0F);
                //GL.Rotate(-f27 * 20F, 0.0F, 0.0F, 1.0F);
                //GL.Rotate(-f27 * 80F, 1.0F, 0.0F, 0.0F);
                f14 = 0.38F;
                //GL.Scale(f14, f14, f14);
                //GL.Rotate(90F, 0.0F, 1.0F, 0.0F);
                //GL.Rotate(180F, 0.0F, 0.0F, 1.0F);
                //GL.Translate(-1F, -1F, 0.0F);
                f20 = 0.015625F;
                //GL.Scale(f20, f20, f20);
                Mc.RenderEngineOld.BindTexture(Mc.RenderEngineOld.GetTexture("/misc/mapbg.png"));
                Tessellator tessellator = Tessellator.Instance;
                //GL.Normal3(0.0F, 0.0F, -1F);
                tessellator.StartDrawingQuads();
                sbyte byte0 = 7;
                tessellator.AddVertexWithUV(0 - byte0, 128 + byte0, 0.0F, 0.0F, 1.0D);
                tessellator.AddVertexWithUV(128 + byte0, 128 + byte0, 0.0F, 1.0D, 1.0D);
                tessellator.AddVertexWithUV(128 + byte0, 0 - byte0, 0.0F, 1.0D, 0.0F);
                tessellator.AddVertexWithUV(0 - byte0, 0 - byte0, 0.0F, 0.0F, 0.0F);
                tessellator.Draw();
                MapData mapdata = Item.Map.GetMapData(itemstack, Mc.TheWorld);
                MapItemRenderer.RenderMap(Mc.ThePlayer, Mc.RenderEngineOld, mapdata);
                //GL.PopMatrix();
            }
            else if (itemstack != null)
            {
                //GL.PushMatrix();
                //	float f6 = 0.8F;

                if (entityplayersp.GetItemInUseCount() > 0)
                {
                    EnumAction enumaction = itemstack.GetItemUseAction();

                    if (enumaction == EnumAction.Eat || enumaction == EnumAction.Drink)
                    {
                        float f15 = ((float)entityplayersp.GetItemInUseCount() - par1) + 1.0F;
                        float f21 = 1.0F - f15 / (float)itemstack.GetMaxItemUseDuration();
                        float f28 = f21;
                        float f31 = 1.0F - f28;
                        f31 = f31 * f31 * f31;
                        f31 = f31 * f31 * f31;
                        f31 = f31 * f31 * f31;
                        float f35 = 1.0F - f31;
                        //GL.Translate(0.0F, MathHelper.Abs(MathHelper.Cos((f15 / 4F) * (float)Math.PI) * 0.1F) * (float)((double)f28 <= 0.20000000000000001D ? 0 : 1), 0.0F);
                        //GL.Translate(f35 * 0.6F, -f35 * 0.5F, 0.0F);
                        //GL.Rotate(f35 * 90F, 0.0F, 1.0F, 0.0F);
                        //GL.Rotate(f35 * 10F, 1.0F, 0.0F, 0.0F);
                        //GL.Rotate(f35 * 30F, 0.0F, 0.0F, 1.0F);
                    }
                }
                else
                {
                    float f10 = entityplayersp.GetSwingProgress(par1);
                    float f16 = MathHelper2.Sin(f10 * (float)Math.PI);
                    float f22 = MathHelper2.Sin(MathHelper2.Sqrt_float(f10) * (float)Math.PI);
                    //GL.Translate(-f22 * 0.4F, MathHelper.Sin(MathHelper.Sqrt_float(f10) * (float)Math.PI * 2.0F) * 0.2F, -f16 * 0.2F);
                }

                //GL.Translate(0.7F * f6, -0.65F * f6 - (1.0F - f) * 0.6F, -0.9F * f6);
                //GL.Rotate(45F, 0.0F, 1.0F, 0.0F);
                //GL.Enable(EnableCap.RescaleNormal);
                float f11 = entityplayersp.GetSwingProgress(par1);
                float f17 = MathHelper2.Sin(f11 * f11 * (float)Math.PI);
                float f23 = MathHelper2.Sin(MathHelper2.Sqrt_float(f11) * (float)Math.PI);
                //GL.Rotate(-f17 * 20F, 0.0F, 1.0F, 0.0F);
                //GL.Rotate(-f23 * 20F, 0.0F, 0.0F, 1.0F);
                //GL.Rotate(-f23 * 80F, 1.0F, 0.0F, 0.0F);
                f11 = 0.4F;
                //GL.Scale(f11, f11, f11);

                if (entityplayersp.GetItemInUseCount() > 0)
                {
                    EnumAction enumaction1 = itemstack.GetItemUseAction();

                    if (enumaction1 == EnumAction.Block)
                    {
                        //GL.Translate(-0.5F, 0.2F, 0.0F);
                        //GL.Rotate(30F, 0.0F, 1.0F, 0.0F);
                        //GL.Rotate(-80F, 1.0F, 0.0F, 0.0F);
                        //GL.Rotate(60F, 0.0F, 1.0F, 0.0F);
                    }
                    else if (enumaction1 == EnumAction.Bow)
                    {
                        //GL.Rotate(-18F, 0.0F, 0.0F, 1.0F);
                        //GL.Rotate(-12F, 0.0F, 1.0F, 0.0F);
                        //GL.Rotate(-8F, 1.0F, 0.0F, 0.0F);
                        //GL.Translate(-0.9F, 0.2F, 0.0F);
                        float f24 = (float)itemstack.GetMaxItemUseDuration() - (((float)entityplayersp.GetItemInUseCount() - par1) + 1.0F);
                        float f29 = f24 / 20F;
                        f29 = (f29 * f29 + f29 * 2.0F) / 3F;

                        if (f29 > 1.0F)
                        {
                            f29 = 1.0F;
                        }

                        if (f29 > 0.1F)
                        {
                            //GL.Translate(0.0F, MathHelper.Sin((f24 - 0.1F) * 1.3F) * 0.01F * (f29 - 0.1F), 0.0F);
                        }

                        //GL.Translate(0.0F, 0.0F, f29 * 0.1F);
                        //GL.Rotate(-335F, 0.0F, 0.0F, 1.0F);
                        //GL.Rotate(-50F, 0.0F, 1.0F, 0.0F);
                        //GL.Translate(0.0F, 0.5F, 0.0F);
                        float f32 = 1.0F + f29 * 0.2F;
                        //GL.Scale(1.0F, 1.0F, f32);
                        //GL.Translate(0.0F, -0.5F, 0.0F);
                        //GL.Rotate(50F, 0.0F, 1.0F, 0.0F);
                        //GL.Rotate(335F, 0.0F, 0.0F, 1.0F);
                    }
                }

                if (itemstack.GetItem().ShouldRotateAroundWhenRendering())
                {
                    //GL.Rotate(180F, 0.0F, 1.0F, 0.0F);
                }

                if (itemstack.GetItem().Func_46058_c())
                {
                    RenderItem(entityplayersp, itemstack, 0);
                    int   i1  = Item.ItemsList[itemstack.ItemID].GetColorFromDamage(itemstack.GetItemDamage(), 1);
                    float f25 = (float)(i1 >> 16 & 0xff) / 255F;
                    float f30 = (float)(i1 >> 8 & 0xff) / 255F;
                    float f33 = (float)(i1 & 0xff) / 255F;
                    //GL.Color4(f3 * f25, f3 * f30, f3 * f33, 1.0F);
                    RenderItem(entityplayersp, itemstack, 1);
                }
                else
                {
                    RenderItem(entityplayersp, itemstack, 0);
                }

                //GL.PopMatrix();
            }
            else
            {
                //GL.PushMatrix();
                //	float f7 = 0.8F;
                float f12 = entityplayersp.GetSwingProgress(par1);
                float f18 = MathHelper2.Sin(f12 * (float)Math.PI);
                float f26 = MathHelper2.Sin(MathHelper2.Sqrt_float(f12) * (float)Math.PI);
                //GL.Translate(-f26 * 0.3F, MathHelper.Sin(MathHelper.Sqrt_float(f12) * (float)Math.PI * 2.0F) * 0.4F, -f18 * 0.4F);
                //GL.Translate(0.8F * f7, -0.75F * f7 - (1.0F - f) * 0.6F, -0.9F * f7);
                //GL.Rotate(45F, 0.0F, 1.0F, 0.0F);
                //GL.Enable(EnableCap.RescaleNormal);
                f12 = entityplayersp.GetSwingProgress(par1);
                f18 = MathHelper2.Sin(f12 * f12 * (float)Math.PI);
                f26 = MathHelper2.Sin(MathHelper2.Sqrt_float(f12) * (float)Math.PI);
                //GL.Rotate(f26 * 70F, 0.0F, 1.0F, 0.0F);
                //GL.Rotate(-f18 * 20F, 0.0F, 0.0F, 1.0F);
                //GL.BindTexture(TextureTarget.Texture2D, Mc.RenderEngineOld.GetTextureForDownloadableImage(Mc.ThePlayer.SkinUrl, Mc.ThePlayer.GetTexture()));
                //GL.Translate(-1F, 3.6F, 3.5F);
                //GL.Rotate(120F, 0.0F, 0.0F, 1.0F);
                //GL.Rotate(200F, 1.0F, 0.0F, 0.0F);
                //GL.Rotate(-135F, 0.0F, 1.0F, 0.0F);
                //GL.Scale(1.0F, 1.0F, 1.0F);
                //GL.Translate(5.6F, 0.0F, 0.0F);
                Render       render       = RenderManager.Instance.GetEntityRenderObject(Mc.ThePlayer);
                RenderPlayer renderplayer = (RenderPlayer)render;
                f26 = 1.0F;
                //GL.Scale(f26, f26, f26);
                renderplayer.DrawFirstPersonHand();
                //GL.PopMatrix();
            }

            //GL.Disable(EnableCap.RescaleNormal);
            RenderHelper.DisableStandardItemLighting();
        }
Beispiel #23
0
        /// <summary>
        /// List all detail cost for master cost center rate
        /// </summary>
        /// <param name="pintMasterID"></param>
        /// <returns></returns>

        public DataSet GetDetailCost(int pintMasterID, EnumAction pMode)
        {
            STD_CostCenterRateDetailDS dsDetail = new STD_CostCenterRateDetailDS();

            if (pintMasterID > 0)
            {
                DataSet   dstData        = dsDetail.List(pintMasterID);
                DataTable dtbMissElement = dsDetail.GetMissElement(pintMasterID);
                DataTable dtbCopy        = dstData.Tables[0].Copy();
                if (pMode == EnumAction.Edit)
                {
                    if (dtbMissElement.Rows.Count > 0)
                    {
                        // clear original data first
                        dstData.Tables[0].Clear();
                        // now make new data with miss element is Added row
                        for (int i = 0; i < dtbCopy.Rows.Count; i++)
                        {
                            // source row
                            DataRow drowData = dtbCopy.Rows[i];
                            // new row
                            DataRow drowNew = dstData.Tables[0].NewRow();
                            // copy value
                            foreach (DataColumn dcolName in dtbCopy.Columns)
                            {
                                drowNew[dcolName.ColumnName] = drowData[dcolName.ColumnName];
                            }
                            if (drowData[STD_CostCenterRateDetailTable.COSTCENTERRATEDETAILID_FLD].Equals(DBNull.Value))
                            {
                                drowNew[STD_CostCenterRateDetailTable.COSTCENTERRATEMASTERID_FLD] = pintMasterID;
                                drowNew[STD_CostCenterRateDetailTable.COSTCENTERRATEDETAILID_FLD] = pintMasterID;
                                dstData.Tables[0].Rows.Add(drowNew);
                            }
                            else
                            {
                                dstData.Tables[0].Rows.Add(drowNew);
                                dstData.Tables[0].Rows[i].AcceptChanges();
                            }
                        }
                    }
                }
                else
                {
                    if (dtbMissElement.Rows.Count > 0)
                    {
                        // remove miss element from detail
                        foreach (DataRow drowData in dstData.Tables[0].Rows)
                        {
                            if (drowData[STD_CostCenterRateDetailTable.COSTCENTERRATEDETAILID_FLD].Equals(DBNull.Value))
                            {
                                drowData.Delete();
                            }
                        }
                        dstData.AcceptChanges();
                    }
                }
                return(dstData);
            }
            else
            {
                return(dsDetail.List());
            }
        }
Beispiel #24
0
 static JDFAutoNewComment()
 {
     atrInfoTable[0] = new AtrInfoTable(AttributeName.ACTION, 0x22222222, AttributeInfo.EnumAttributeType.enumeration, EnumAction.getEnum(0), null);
     atrInfoTable[1] = new AtrInfoTable(AttributeName.COMMENTID, 0x33333333, AttributeInfo.EnumAttributeType.NMTOKEN, null, null);
     atrInfoTable[2] = new AtrInfoTable(AttributeName.REFID, 0x22222222, AttributeInfo.EnumAttributeType.NMTOKEN, null, null);
 }
Beispiel #25
0
 ///
 ///          <summary> * (9) get attribute Action </summary>
 ///          * <returns> the value of the attribute </returns>
 ///
 public virtual EnumAction getAction()
 {
     return(EnumAction.getEnum(getAttribute(AttributeName.ACTION, null, null)));
 }
Beispiel #26
0
 public LogFilter(EnumAction action, ILogger <LogFilter> logger)
 {
     this._logger = logger;
     this._action = action;
 }
Beispiel #27
0
        //**************************************************************************
        ///    <Description>
        ///       Validate data and save new group information
        ///    </Description>
        ///    <Inputs>
        ///
        ///    </Inputs>
        ///    <Outputs>
        ///
        ///    </Outputs>
        ///    <Returns>
        ///
        ///    </Returns>
        ///    <Authors>
        ///       DungLA
        ///    </Authors>
        ///    <History>
        ///       06-Jan-2005
        ///    </History>
        ///    <Notes>
        ///    </Notes>
        //**************************************************************************
        private void btnSave_Click(object sender, EventArgs e)
        {
            // Code Inserted Automatically

            #region Code Inserted Automatically

            this.Cursor = Cursors.WaitCursor;

            #endregion Code Inserted Automatically


            const string METHOD_NAME = THIS + ".btnSave_Click()";
            try
            {
                // check mandatory fields
                if (!CheckMandatory(txtGroupCode))
                {
                    PCSMessageBox.Show(ErrorCode.MANDATORY_INVALID);
                    txtGroupCode.Focus();
                    txtGroupCode.Select();
                    // Code Inserted Automatically
                    #region Code Inserted Automatically
                    this.Cursor = Cursors.Default;
                    #endregion Code Inserted Automatically

                    return;
                }
                if (!CheckMandatory(txtGroupName))
                {
                    PCSMessageBox.Show(ErrorCode.MANDATORY_INVALID);
                    txtGroupName.Focus();
                    txtGroupName.Select();
                    // Code Inserted Automatically
                    #region Code Inserted Automatically
                    this.Cursor = Cursors.Default;
                    #endregion Code Inserted Automatically

                    return;
                }


                bool blnIsSaveDataOK = false;
                try
                {
                    blnIsSaveDataOK = SaveData();
                    if (blnIsSaveDataOK)
                    {
                        PCSMessageBox.Show(ErrorCode.MESSAGE_AFTER_SAVE_DATA, MessageBoxIcon.Information);
                        //DialogResult = DialogResult.OK;
                        mEnumType = EnumAction.Default;
                        // close the form after save succeed
                        this.Close();
                    }
                    else
                    {
                        PCSMessageBox.Show(ErrorCode.MESSAGE_CANNOT_SAVE_TO_DB, MessageBoxIcon.Error);
                    }
                }
                catch (PCSException ex)
                {
                    // displays the error message.
                    PCSMessageBox.Show(ex.mCode, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    // log message.
                    try
                    {
                        Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                    }
                    catch
                    {
                        PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                    }
                    txtGroupName.Select();
                }
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
            }

            // Code Inserted Automatically

            #region Code Inserted Automatically

            this.Cursor = Cursors.Default;

            #endregion Code Inserted Automatically
        }
Beispiel #28
0
 public PermissionAttribute(EnumRole role, EnumEntity entity, EnumAction action)
 {
     this.Role   = role;
     this.Entity = entity;
     this.Action = action;
 }
Beispiel #29
0
        // ************************************************************************
        // * Attribute getter / setter
        // * ************************************************************************
        //

        //         ---------------------------------------------------------------------
        //        Methods for Attribute Action
        //        ---------------------------------------------------------------------
        ///
        ///          <summary> * (5) set attribute Action </summary>
        ///          * <param name="enumVar">: the enumVar to set the attribute to </param>
        ///
        public virtual void setAction(EnumAction enumVar)
        {
            setAttribute(AttributeName.ACTION, enumVar == null ? null : enumVar.getName(), null);
        }
        /// <summary>
        /// Method for adding special render rules
        /// </summary>
        protected virtual void RenderSpecials(EntityPlayer par1EntityPlayer, float par2)
        {
            base.RenderEquippedItems(par1EntityPlayer, par2);
            ItemStack itemstack = par1EntityPlayer.Inventory.ArmorItemInSlot(3);

            if (itemstack != null && itemstack.GetItem().ShiftedIndex < 256)
            {
                //GL.PushMatrix();
                ModelBipedMain.BipedHead.PostRender(0.0625F);

                if (RenderBlocks.RenderItemIn3d(Block.BlocksList[itemstack.ItemID].GetRenderType()))
                {
                    float f = 0.625F;
                    //GL.Translate(0.0F, -0.25F, 0.0F);
                    //GL.Rotate(180F, 0.0F, 1.0F, 0.0F);
                    //GL.Scale(f, -f, f);
                }

                RenderManager.ItemRenderer.RenderItem(par1EntityPlayer, itemstack, 0);
                //GL.PopMatrix();
            }

            if (par1EntityPlayer.Username.Equals("deadmau5") && LoadDownloadableImageTexture(par1EntityPlayer.SkinUrl, null))
            {
                for (int i = 0; i < 2; i++)
                {
                    float f1 = (par1EntityPlayer.PrevRotationYaw + (par1EntityPlayer.RotationYaw - par1EntityPlayer.PrevRotationYaw) * par2) - (par1EntityPlayer.PrevRenderYawOffset + (par1EntityPlayer.RenderYawOffset - par1EntityPlayer.PrevRenderYawOffset) * par2);
                    float f2 = par1EntityPlayer.PrevRotationPitch + (par1EntityPlayer.RotationPitch - par1EntityPlayer.PrevRotationPitch) * par2;
                    //GL.PushMatrix();
                    //GL.Rotate(f1, 0.0F, 1.0F, 0.0F);
                    //GL.Rotate(f2, 1.0F, 0.0F, 0.0F);
                    //GL.Translate(0.375F * (float)(i * 2 - 1), 0.0F, 0.0F);
                    //GL.Translate(0.0F, -0.375F, 0.0F);
                    //GL.Rotate(-f2, 1.0F, 0.0F, 0.0F);
                    //GL.Rotate(-f1, 0.0F, 1.0F, 0.0F);
                    float f7 = 1.333333F;
                    //GL.Scale(f7, f7, f7);
                    ModelBipedMain.RenderEars(0.0625F);
                    //GL.PopMatrix();
                }
            }

            if (LoadDownloadableImageTexture(par1EntityPlayer.PlayerCloakUrl, null))
            {
                //GL.PushMatrix();
                //GL.Translate(0.0F, 0.0F, 0.125F);
                double d   = (par1EntityPlayer.Field_20066_r + (par1EntityPlayer.Field_20063_u - par1EntityPlayer.Field_20066_r) * (double)par2) - (par1EntityPlayer.PrevPosX + (par1EntityPlayer.PosX - par1EntityPlayer.PrevPosX) * (double)par2);
                double d1  = (par1EntityPlayer.Field_20065_s + (par1EntityPlayer.Field_20062_v - par1EntityPlayer.Field_20065_s) * (double)par2) - (par1EntityPlayer.PrevPosY + (par1EntityPlayer.PosY - par1EntityPlayer.PrevPosY) * (double)par2);
                double d2  = (par1EntityPlayer.Field_20064_t + (par1EntityPlayer.Field_20061_w - par1EntityPlayer.Field_20064_t) * (double)par2) - (par1EntityPlayer.PrevPosZ + (par1EntityPlayer.PosZ - par1EntityPlayer.PrevPosZ) * (double)par2);
                float  f10 = par1EntityPlayer.PrevRenderYawOffset + (par1EntityPlayer.RenderYawOffset - par1EntityPlayer.PrevRenderYawOffset) * par2;
                double d3  = MathHelper2.Sin((f10 * (float)Math.PI) / 180F);
                double d4  = -MathHelper2.Cos((f10 * (float)Math.PI) / 180F);
                float  f12 = (float)d1 * 10F;

                if (f12 < -6F)
                {
                    f12 = -6F;
                }

                if (f12 > 32F)
                {
                    f12 = 32F;
                }

                float f13 = (float)(d * d3 + d2 * d4) * 100F;
                float f14 = (float)(d * d4 - d2 * d3) * 100F;

                if (f13 < 0.0F)
                {
                    f13 = 0.0F;
                }

                float f15 = par1EntityPlayer.PrevCameraYaw + (par1EntityPlayer.CameraYaw - par1EntityPlayer.PrevCameraYaw) * par2;
                f12 += MathHelper2.Sin((par1EntityPlayer.PrevDistanceWalkedModified + (par1EntityPlayer.DistanceWalkedModified - par1EntityPlayer.PrevDistanceWalkedModified) * par2) * 6F) * 32F * f15;

                if (par1EntityPlayer.IsSneaking())
                {
                    f12 += 25F;
                }

                //GL.Rotate(6F + f13 / 2.0F + f12, 1.0F, 0.0F, 0.0F);
                //GL.Rotate(f14 / 2.0F, 0.0F, 0.0F, 1.0F);
                //GL.Rotate(-f14 / 2.0F, 0.0F, 1.0F, 0.0F);
                //GL.Rotate(180F, 0.0F, 1.0F, 0.0F);
                ModelBipedMain.RenderCloak(0.0625F);
                //GL.PopMatrix();
            }

            ItemStack itemstack1 = par1EntityPlayer.Inventory.GetCurrentItem();

            if (itemstack1 != null)
            {
                //GL.PushMatrix();
                ModelBipedMain.BipedRightArm.PostRender(0.0625F);
                //GL.Translate(-0.0625F, 0.4375F, 0.0625F);

                if (par1EntityPlayer.FishEntity != null)
                {
                    itemstack1 = new ItemStack(Item.Stick);
                }

                EnumAction enumaction = EnumAction.None;

                if (par1EntityPlayer.GetItemInUseCount() > 0)
                {
                    enumaction = itemstack1.GetItemUseAction();
                }

                if (itemstack1.ItemID < 256 && RenderBlocks.RenderItemIn3d(Block.BlocksList[itemstack1.ItemID].GetRenderType()))
                {
                    float f3 = 0.5F;
                    //GL.Translate(0.0F, 0.1875F, -0.3125F);
                    f3 *= 0.75F;
                    //GL.Rotate(20F, 1.0F, 0.0F, 0.0F);
                    //GL.Rotate(45F, 0.0F, 1.0F, 0.0F);
                    //GL.Scale(f3, -f3, f3);
                }
                else if (itemstack1.ItemID == Item.Bow.ShiftedIndex)
                {
                    float f4 = 0.625F;
                    //GL.Translate(0.0F, 0.125F, 0.3125F);
                    //GL.Rotate(-20F, 0.0F, 1.0F, 0.0F);
                    //GL.Scale(f4, -f4, f4);
                    //GL.Rotate(-100F, 1.0F, 0.0F, 0.0F);
                    //GL.Rotate(45F, 0.0F, 1.0F, 0.0F);
                }
                else if (Item.ItemsList[itemstack1.ItemID].IsFull3D())
                {
                    float f5 = 0.625F;

                    if (Item.ItemsList[itemstack1.ItemID].ShouldRotateAroundWhenRendering())
                    {
                        //GL.Rotate(180F, 0.0F, 0.0F, 1.0F);
                        //GL.Translate(0.0F, -0.125F, 0.0F);
                    }

                    if (par1EntityPlayer.GetItemInUseCount() > 0 && enumaction == EnumAction.Block)
                    {
                        //GL.Translate(0.05F, 0.0F, -0.1F);
                        //GL.Rotate(-50F, 0.0F, 1.0F, 0.0F);
                        //GL.Rotate(-10F, 1.0F, 0.0F, 0.0F);
                        //GL.Rotate(-60F, 0.0F, 0.0F, 1.0F);
                    }

                    //GL.Translate(0.0F, 0.1875F, 0.0F);
                    //GL.Scale(f5, -f5, f5);
                    //GL.Rotate(-100F, 1.0F, 0.0F, 0.0F);
                    //GL.Rotate(45F, 0.0F, 1.0F, 0.0F);
                }
                else
                {
                    float f6 = 0.375F;
                    //GL.Translate(0.25F, 0.1875F, -0.1875F);
                    //GL.Scale(f6, f6, f6);
                    //GL.Rotate(60F, 0.0F, 0.0F, 1.0F);
                    //GL.Rotate(-90F, 1.0F, 0.0F, 0.0F);
                    //GL.Rotate(20F, 0.0F, 0.0F, 1.0F);
                }

                if (itemstack1.GetItem().Func_46058_c())
                {
                    for (int j = 0; j <= 1; j++)
                    {
                        int   k   = itemstack1.GetItem().GetColorFromDamage(itemstack1.GetItemDamage(), j);
                        float f8  = (float)(k >> 16 & 0xff) / 255F;
                        float f9  = (float)(k >> 8 & 0xff) / 255F;
                        float f11 = (float)(k & 0xff) / 255F;
                        //GL.Color4(f8, f9, f11, 1.0F);
                        RenderManager.ItemRenderer.RenderItem(par1EntityPlayer, itemstack1, j);
                    }
                }
                else
                {
                    RenderManager.ItemRenderer.RenderItem(par1EntityPlayer, itemstack1, 0);
                }

                //GL.PopMatrix();
            }
        }