Пример #1
0
        public Pilot(SRC src, PilotData data)
        {
            SRC  = src;
            Data = data;

            Update();
        }
Пример #2
0
    //==================================================================
    //
    //==================================================================

    private void UpdatePilotSelection()
    {
        int       index = GameController.Instance.PlayerData.CurrentPilotIndex;
        PilotData pilot = GameController.Instance.PilotData[index];

        _pilotNameText.text = pilot.Name;

        if (pilot.Unlocked)
        {
            _pilotXpText.text = "XP: " + pilot.Experience;
        }
        else
        {
            _pilotXpText.text = "Cost: " + pilot.Cost;
        }

        if (index == 0)
        {
            _pilotLeftButton.interactable = false;
        }
        else
        {
            _pilotLeftButton.interactable = true;
        }

        if (index == GameController.Instance.PilotData.Count - 1)
        {
            _pilotRightButton.interactable = false;
        }
        else
        {
            _pilotRightButton.interactable = true;
        }
    }
Пример #3
0
    //==================================================================
    //
    //==================================================================

    private void LoadStatBar(PlayerData playerData, PilotData pilotData)
    {
        _nameText.text = "Name: " + pilotData.Name;
        _xpText.text   = "XP: " + pilotData.Experience;

        _accelerationText.text = "Acceleration: +" + pilotData.Acceleration + "%";
        _turnSpeedText.text    = "Turn Speed: +" + pilotData.TurnSpeed + "%";
        _massText.text         = "Mass: +" + pilotData.Mass + "%";
    }
Пример #4
0
    void Awake()
    {
        _playerPilotData = GameObject.FindGameObjectWithTag("PlayerObject").GetComponent <PilotData>();

        //Debug values.
        AddMission("Missions/Visit Mars");
        AddMission("Missions/Kill Heavy Fighter");
        AddMission("Missions/Go to Sirius");
    }
Пример #5
0
 //defunct, but just incase we need to reload this at some point..
 public void SetPlayerPilotData()
 {
     if (playerPilotData == null)
     {
         gameController  = GameObject.FindGameObjectWithTag("GameController");
         playerObject    = GameObject.FindGameObjectWithTag("PlayerObject");
         _menuManager    = gameController.GetComponent <MenuManager>();
         playerPilotData = playerObject.GetComponent <PilotData>();
         shipData        = playerObject.transform.GetChild(0).GetComponent <ShipData>();
     }
 }
Пример #6
0
    public void OnBuyButtonPressed()
    {
        PlayerData playerData = GameController.Instance.PlayerData;
        PilotData  pilotData  = GameController.Instance.PilotData[playerData.CurrentPilotIndex];

        if (!pilotData.Unlocked && playerData.Money >= pilotData.Cost)
        {
            playerData.Money  -= pilotData.Cost;
            pilotData.Unlocked = true;

            OnEnter();
        }
    }
Пример #7
0
    protected void btnName_Click(object sender, EventArgs e)
    {
        EmpListDiv.Visible = false;
        string    _fname = txtFirst.Text;
        string    _lname = txtLast.Text;
        PilotData pObj   = new PilotData();
        DataSet   ds     = pObj.searchPilot(_fname, _lname);

        dsstore = ds;
        ViewState["tempdata"]   = ds;
        grdvEmployee.DataSource = ds;
        grdvEmployee.DataBind();
        SortGridView("empl_lname ASC, empl_fname ASC , empl_empno ASC", "");
    }
Пример #8
0
    public void OnUpgradeButtonPressed()
    {
        PlayerData playerData = GameController.Instance.PlayerData;
        PilotData  pilotData  = GameController.Instance.PilotData[playerData.CurrentPilotIndex];

        int xpPrice = (pilotData.Upgrade.CurrentLevel + 1) * pilotData.Upgrade.LevelExpCost;

        if (pilotData.Experience >= xpPrice)
        {
            pilotData.Experience -= xpPrice;
            pilotData.Upgrade.CurrentLevel++;

            OnEnter();
        }
    }
Пример #9
0
    //=======================================================================================
    //
    //=======================================================================================

    public void Load()
    {
        if (File.Exists(GameController.DATAPATH + "/Pilot_" + _name + ".dat"))
        {
            BinaryFormatter bf = new BinaryFormatter();
            FileStream      fs = File.Open(GameController.DATAPATH + "/Pilot_" + _name + ".dat", FileMode.Open);

            PilotData data = (PilotData)bf.Deserialize(fs);
            fs.Close();

            Experience = data.Experience;
            Upgrade    = data.Upgrade;
            Unlocked   = data.Unlocked;
        }
    }
Пример #10
0
    //=====================================================================================================
    //
    //=====================================================================================================

    // Use this for initialization
    void Start()
    {
        _movRectHalfSize = _movementRectangle.rect.size * 0.5f;

        if (GameController.Instance != null)
        {
            PlayerData player = GameController.Instance.PlayerData;
            PilotData  pilot  = GameController.Instance.PilotData[player.CurrentPilotIndex];
            BookData   book   = GameController.Instance.BookData[player.CurrentBookIndex];

            _acceleration          = book.Acceleration * (1 + pilot.Acceleration / 100f) * 100f;
            _angularAcceleration   = book.TurnSpeed * (1 + pilot.TurnSpeed / 100f) * 100f;
            _vehicleRigidbody.mass = book.Mass * (1 + pilot.Mass / 100f) * 100f;
        }
    }
Пример #11
0
    //==================================================================
    //
    //==================================================================

    protected override void OnEnter()
    {
        PlayerData playerData = GameController.Instance.PlayerData;
        PilotData  pilotData  = GameController.Instance.PilotData[playerData.CurrentPilotIndex];

        LoadStatBar(playerData, pilotData);

        if (pilotData.Unlocked)
        {
            LoadUpgradePanel(playerData, pilotData);
        }
        else
        {
            LoadBuyPanel(playerData, pilotData);
        }
    }
Пример #12
0
    protected void btnEmpno_Click(object sender, EventArgs e)
    {
        EmpListDiv.Visible = false;
        int empno = Int32.Parse(txtEmpno.Text.ToString());

        Session["empno"] = empno;
        PilotData pObj   = new PilotData();
        bool      status = pObj.checkExistRecord(empno);

        if (status)
        {
            Session["taskId"] = Convert.ToInt32(Session["taskId"]) + 1;
            Response.Redirect("~/HRA/Maintenance/Pilot.aspx");
        }
        else
        {
            lblError.Text = "Employee number not found!";
        }
    }
Пример #13
0
    protected void btnSSN_Click(object sender, EventArgs e)
    {
        EmpListDiv.Visible = false;
        string ssn = txtSSN.Text.ToString();

        Session["ssn"] = ssn;
        PilotData pObj   = new PilotData();
        bool      status = pObj.checkExistRecord(ssn);

        if (status)
        {
            Session["taskId"] = Convert.ToInt32(Session["taskId"]) + 1;
            Response.Redirect("~/HRA/Maintenance/Pilot.aspx");
        }
        else
        {
            lblError.Text = "Employee SSN not found!";
        }
    }
Пример #14
0
    private void LoadBuyPanel(PlayerData player, PilotData pilot)
    {
        _upgradeCanvasGroup.alpha          = 0;
        _upgradeCanvasGroup.interactable   = false;
        _upgradeCanvasGroup.blocksRaycasts = false;

        _buyCanvasGroup.alpha          = 1;
        _buyCanvasGroup.interactable   = true;
        _buyCanvasGroup.blocksRaycasts = true;

        _buyCostText.text = "Cost: " + pilot.Cost;

        if (player.Money >= pilot.Cost)
        {
            _buyButton.interactable = true;
        }
        else
        {
            _buyButton.interactable = false;
        }
    }
Пример #15
0
 void Awake()
 {
     _playerPilotData = playerObject.GetComponent <PilotData>();
     _playerShip      = playerObject.transform.GetChild(0).gameObject;
 }
Пример #16
0
    protected void lnkGen1_Click(object sender, EventArgs e)
    {
        string _ltrType = ddlLetterType.SelectedItem.Text;
        string _ltrCode = ddlLetterType.SelectedItem.Value;
        string _empnums = txtEmpNum.Text.Trim();

        clearMessages();
        List <string> _elList0       = new List <string>();
        List <string> _elList1       = new List <string>();
        string        _exceptionEmpl = "";

        LetterGen gObj   = new LetterGen("EBAnamespace");
        Type      cstype = this.GetType();

        try
        {
            if (rdbFilter.SelectedValue.Equals("0"))
            {
                int                 _version = LettersGenDAL.getTemplateVersion(_ltrCode);
                string[]            _Letter  = gObj.generateLetter(_ltrCode, _version, false);
                ClientScriptManager cs       = Page.ClientScript;

                string _filepath = "C:\\EBATemp\\";
                string _file     = _filepath + "Print.xml";

                int _seq = 0;

                foreach (string _lt in _Letter)
                {
                    try
                    {
                        if (!cs.IsClientScriptBlockRegistered(_seq + "SaveExcel"))
                        {
                            cs.RegisterClientScriptBlock(typeof(Page), _seq + "SaveExcel", "SaveTextFile('" + _lt.Replace(Environment.NewLine, "") + "', '" + _file.Replace("\\", "\\\\") + "');", true);
                        }

                        if (!cs.IsClientScriptBlockRegistered(_seq + "PrintWord"))
                        {
                            cs.RegisterClientScriptBlock(typeof(Page), _seq + "PrintWord", "PrintWord('" + _file.Replace("\\", "\\\\") + "');", true);
                        }
                    }
                    finally
                    {
                        EndProcess();
                        if (!cs.IsClientScriptBlockRegistered(_seq + "DeleteFile"))
                        {
                            cs.RegisterClientScriptBlock(typeof(Page), _seq + "DeleteFile", "DeleteFile('" + _file.Replace("\\", "\\\\") + "');", true);
                        }
                    }
                    _seq++;
                }
            }
            else if (rdbFilter.SelectedValue.Equals("1"))
            {
                if (!_empnums.Equals(""))
                {
                    _elList0 = gObj.createEmpList(_empnums);
                    foreach (string _empl in _elList0)
                    {
                        PilotData pData  = new PilotData();
                        int       _order = pData.getBeneficiaryOrders(Convert.ToInt32(_empl));
                        if (_order == 0)
                        {
                            //The following logic was replaced due to an exception ..3/9/2009 R.A - as per Andrea D
                            // The Ben Designation letter should print even when there are no dependants for a Pilot
                            //_exceptionEmpl += " " + _empl + ",";
                            //Added this line..where Pilots with no deps are added to the _elist to print the letter
                            _elList1.Add(_empl);
                        }
                        else
                        {
                            _elList1.Add(_empl);
                        }
                        pData = null;
                    }
                    if (!_exceptionEmpl.Equals(""))
                    {
                        infoDiv1.Visible = true;
                        _exceptionEmpl   = _exceptionEmpl.Remove(_exceptionEmpl.Length - 1);
                        lblInfo.Text     = "Employee number(s) <br/>" + _exceptionEmpl + "<br/> don't have any Beneficiary Listed. <br/> No Letters were generated for above Employee Numbers";
                    }
                }

                string _empListFinal = gObj.createEmplCSV(_elList1);

                int                 _version = LettersGenDAL.getTemplateVersion(_ltrCode);
                string[]            _Letter  = gObj.generateLetter(_empListFinal, _ltrCode, _version);
                ClientScriptManager cs       = Page.ClientScript;

                string _filepath = "C:\\EBATemp\\";
                string _file     = _filepath + "Print.xml";


                int _seq = 0;

                foreach (string _lt in _Letter)
                {
                    try
                    {
                        if (!cs.IsClientScriptBlockRegistered(_seq + "SaveExcel"))
                        {
                            cs.RegisterClientScriptBlock(typeof(Page), _seq + "SaveExcel", "SaveTextFile('" + _lt.Replace(Environment.NewLine, "") + "', '" + _file.Replace("\\", "\\\\") + "');", true);
                        }

                        if (!cs.IsClientScriptBlockRegistered(_seq + "PrintWord"))
                        {
                            cs.RegisterClientScriptBlock(typeof(Page), _seq + "PrintWord", "PrintWord('" + _file.Replace("\\", "\\\\") + "');", true);
                        }
                    }
                    finally
                    {
                        EndProcess();
                        if (!cs.IsClientScriptBlockRegistered(_seq + "DeleteFile"))
                        {
                            cs.RegisterClientScriptBlock(typeof(Page), _seq + "DeleteFile", "DeleteFile('" + _file.Replace("\\", "\\\\") + "');", true);
                        }
                    }
                    _seq++;
                }
            }
        }
        catch (Exception ex)
        {
            clearMessages();
            errorDiv1.Visible = true;
            lbl_error.Text    = "Some error occured while printing letters - " + ex.Message;
        }
        finally
        {
            Alert.Show("The Summary Plan Description (SPD) Addendum can be printed by clicking on the Generate SPD Letter");
        }
    }
Пример #17
0
    private void LoadUpgradePanel(PlayerData playerData, PilotData pilotData)
    {
        _buyCanvasGroup.alpha          = 0;
        _buyCanvasGroup.interactable   = false;
        _buyCanvasGroup.blocksRaycasts = false;

        _upgradeCanvasGroup.alpha          = 1;
        _upgradeCanvasGroup.interactable   = true;
        _upgradeCanvasGroup.blocksRaycasts = true;

        _upgradeLevelText.text = "UpgradeLevel: " + pilotData.Upgrade.CurrentLevel + "/" + pilotData.Upgrade.NumLevels;

        switch (pilotData.Upgrade.Stat)
        {
        case EVehicleStat.acceleration:
            _upgradeBonusText.text = "Acceleration: +" + pilotData.Upgrade.CurrentLevel * pilotData.Upgrade.ValuePerLevel + "%";
            break;

        case EVehicleStat.mass:
            _upgradeBonusText.text = "Mass: +" + pilotData.Upgrade.CurrentLevel * pilotData.Upgrade.ValuePerLevel + "%";
            break;

        case EVehicleStat.turnSpeed:
            _upgradeBonusText.text = "Turn Speed: +" + pilotData.Upgrade.CurrentLevel * pilotData.Upgrade.ValuePerLevel + "%";
            break;
        }

        if (pilotData.Upgrade.CurrentLevel < pilotData.Upgrade.NumLevels)
        {
            _upgradeButton.enabled = true;

            int xpPrice = (pilotData.Upgrade.CurrentLevel + 1) * pilotData.Upgrade.LevelExpCost;

            _upgradeXpPriceText.text = xpPrice + " XP";

            switch (pilotData.Upgrade.Stat)
            {
            case EVehicleStat.acceleration:
                _upgradeImprovementText.text = "Acceleration: +" + pilotData.Upgrade.ValuePerLevel + "%";
                break;

            case EVehicleStat.mass:
                _upgradeImprovementText.text = "Mass: +" + pilotData.Upgrade.ValuePerLevel + "%";
                break;

            case EVehicleStat.turnSpeed:
                _upgradeImprovementText.text = "Turn Speed: +" + pilotData.Upgrade.ValuePerLevel + "%";
                break;
            }

            if (pilotData.Experience >= xpPrice)
            {
                _upgradeButton.interactable = true;
            }
            else
            {
                _upgradeButton.interactable = false;
            }
        }
        else
        {
            _upgradeButton.enabled = false;
        }
    }