Exemple #1
0
    // Use this for initialization
    void Start()
    {
        myItems   = new PlayerItems(Bullet.PlayerMaster.Instance.Money);
        worker    = Bullet.PlayerMaster.Instance.Workers;
        Inventory = Bullet.PlayerMaster.Instance.Inventory;
        UIfunctions UIfunct = functionsUI.GetComponent <UIfunctions>();

        for (int ID = 0; ID < Inventory.Count; ID++)
        {
            functionsUI.GetComponent <UIfunctions>().SetUIElement(Inventory[ID].getamount(), ID, Inventory[ID].isactive());
        }
        //money is a fill bar

        UIfunct.AddWorker(worker);
        UIfunct.AddMoney(myItems.Getmoney());
    }
Exemple #2
0
    public static void updateTestDelStatus(String testID, String processedBy, String CheckedOut, String Accession)
    {
        String timeFormat = UIfunctions.getTimeFormat();

        System.Text.StringBuilder sb = new System.Text.StringBuilder();
        sb.Append("Update ORD_TestDeletion set TD_ProcessingStatus = 'PROC' ,TD_UserProcessedBy ='" + processedBy + "',TD_DateProcessed='" + DateTime.Now.ToString("yyyy-MM-dd") + "',TD_TimeProcessed='" + DateTime.Now.ToString(timeFormat) + "' where TD_RowId = '" + testID + "'");
        CACHEDAL.ConnectionClass cache = new CACHEDAL.ConnectionClass();
        int rows = cache.Insert(sb.ToString());

        Dictionary <String, String> _updateTestDelStatus = new Dictionary <String, String>();

        _updateTestDelStatus.Add("ACCESSION", Accession);
        _updateTestDelStatus.Add("TESTROWID", testID);
        _updateTestDelStatus.Add("USERID", processedBy);
        _updateTestDelStatus.Add("CHECKEDOUT", CheckedOut);
        String strTemp = cache.StoredProcedure("?=call SP2_TDCheckInOut(?,?,?,?)", _updateTestDelStatus).Value.ToString();
    }
Exemple #3
0
    public static void updateTestDelStatus(string testID, string CheckedOut, string checkedBy)
    {
        String timeFormat = UIfunctions.getTimeFormat();

        System.Text.StringBuilder sb = new System.Text.StringBuilder();
        sb.Append("Update ORD_TestDeletion set TD_ProcessingStatus = '" + CheckedOut + "', TD_UserPrintedBy = '" + checkedBy + "',TD_DatePrinted='" + DateTime.Now.ToString("yyyy-MM-dd") + "',TD_TimePrinted='" + DateTime.Now.ToString(timeFormat) + "' where TD_RowId = '" + testID + "'");
        CACHEDAL.ConnectionClass cache = new CACHEDAL.ConnectionClass();
        int       rows        = cache.Insert(sb.ToString());
        DataTable dtAccession = cache.FillCacheDataTable("SELECT TD_AccessionDR FROM ORD_TESTDELETION WHERE TD_ROWID = '" + testID + "'");

        if (dtAccession.Rows.Count > 0)
        {
            Dictionary <String, String> _updateTestDelStatus = new Dictionary <String, String>();
            _updateTestDelStatus.Add("ACCESSION", dtAccession.Rows[0][0].ToString());
            _updateTestDelStatus.Add("TESTROWID", testID);
            _updateTestDelStatus.Add("USERID", checkedBy);
            _updateTestDelStatus.Add("CHECKEDOUT", CheckedOut);
            String strTemp = cache.StoredProcedure("?=call SP2_TDCheckInOut(?,?,?,?)", _updateTestDelStatus).Value.ToString();
        }
    }
        static void Main(string[] args)
        {
            Console.OutputEncoding = System.Text.Encoding.UTF8;

            Console.CursorVisible = false;
            Console.SetWindowSize(Constants.ConsoleWindowWidth, Constants.ConsoleWindowHeight);

            var UI = new UIfunctions();

            UI.DrawStartScreen();
            Console.ReadKey();
            Console.Clear();
            var lives  = Constants.StartingLives;
            var score  = Constants.StartingScore;
            var missed = Constants.MissedShips;

            UI.DrawFrame(lives, score, missed);

            var ship     = new MainShip();
            var gameOver = false;

            int redo = 0;

            ship.DrawShip();

            Stopwatch time = new Stopwatch();

            time.Start();

            do
            {
                if (time.Elapsed.Milliseconds % 100 == 0)
                {
                    bool updateFrame = false;
                    if (time.Elapsed.Seconds % 2 == 0 && time.Elapsed.Milliseconds == 0)
                    {
                        ship.SpawnEnemiyShips();
                    }
                    if ((time.Elapsed.Seconds * 1000 + time.Elapsed.Milliseconds) % 500 == 0)
                    {
                        Enemies.MoveEnemies(ship.EnemyShips, ref missed, ref updateFrame);

                        //game over check
                        gameOver = Enemies.CheckForCollision(ship.EnemyShips, ship);
                        if (missed >= 3)
                        {
                            gameOver = true;
                        }
                        if (gameOver)
                        {
                            if (ship.lives > 0)
                            {
                                UIfunctions.GameOver(UI, ship, ship.EnemyShips, score, ref missed);
                                ship.DrawShip();
                                gameOver = false;
                            }
                            else
                            {
                                UIfunctions.FinalScreen(score);
                                break;
                            }
                        }
                        //end of game over check
                    }
                    if (updateFrame)
                    {
                        Console.SetCursorPosition(78, 48);
                        Console.WriteLine(missed);
                    }
                    ship.UpdateEnemies();
                }
                else if (time.Elapsed.Milliseconds % 50 == 0)
                {
                    ship.UpdateBullets(ref score);
                }
                if (Console.KeyAvailable)
                {
                    ConsoleKeyInfo KeyInfo;
                    while (!Console.KeyAvailable)
                    {
                        //ship.UpdateBullets();
                        ship.UpdateEnemies();
                        Thread.Sleep(50);
                    }
                    KeyInfo = Console.ReadKey(true);
                    ship.MoveShip(KeyInfo, ship, ref ship.position);
                    //game over check
                    gameOver = Enemies.CheckForCollision(ship.EnemyShips, ship);
                    if (gameOver)
                    {
                        if (ship.lives > 0)
                        {
                            UIfunctions.GameOver(UI, ship, ship.EnemyShips, score, ref missed);
                            ship.DrawShip();
                            gameOver = false;
                        }
                        else
                        {
                            UIfunctions.FinalScreen(score);
                            break;
                        }
                    }
                    // end of game over check
                    continue;
                }
            } while (redo == 0);


            Console.ReadKey(true);
        }