Example #1
0
 public CBras(CAX_12 ax12)
 {
     m_position = (int)positionBras.detendu;
     m_ax12 = ax12;
     m_mode = mode.joint;
     m_ax12.setMode(m_mode);
 }
 void NextMode()
 {
     PointCloudAdapter.pointcloud_reset();
     switch(current_mode)
     {
     case mode.SLAM:
         current_mode = mode.IMAGE_TRACKING;
         modeButtonLabel = "Imaged Recognition";
         PointCloudAdapter.pointcloud_disable_map_expansion();
         PointCloudBehaviour.ActivateAllImageTargets();
         break;
     case mode.IMAGE_TRACKING:
         current_mode = mode.IMAGE_TRACKING_SLAM;
         modeButtonLabel = "SLAM from Image";
         PointCloudAdapter.pointcloud_enable_map_expansion();
         PointCloudBehaviour.ActivateAllImageTargets();
         break;
     case mode.IMAGE_TRACKING_SLAM:
     default:
         current_mode = mode.SLAM;
         modeButtonLabel = "SLAM";
         PointCloudBehaviour.DeactivateAllImageTargets();
         PointCloudAdapter.pointcloud_enable_map_expansion();
         break;
     }
     OnPointCloudStateChanged();
 }
Example #3
0
 public void setMode(int modenum)
 {
     switch(modenum){
     case 1: curMode = mode.Preview; break;
     case 2: curMode = mode.Grab; break;
     case 3: curMode = mode.Draw; break;
     }
 }
Example #4
0
 public CPince(CAX_12 ax12)
 {
     m_etat = etat.fermee;
     m_ax12 = ax12;
     m_mode = mode.joint;
     m_ax12.setMode(m_mode);
     m_ax12.setMovingSpeed(speed.slow);
 }
        public ActionResult Detail(int id, mode m)
        {
            ViewBag.mode = m;
            var v_order = (from i in db.shipTo
                           where i.ID == id
                           select i).FirstOrDefault();

            return View(v_order);
        }
Example #6
0
 private void highlightToolStripMenuItem_Click(object sender, EventArgs e)
 {
     highlightToolStripMenuItem.Checked = !highlightToolStripMenuItem.Checked;
     if (highlightToolStripMenuItem.Checked) {
         cameraToolStripMenuItem.Checked = !highlightToolStripMenuItem.Checked;
         CurrentMode = mode.HighlightMode;
         RunningInMode = true;
     } else {
         CurrentMode = mode.FullScreen;
         RunningInMode = false;
     }
 }
 //public frm_Click2Mail()
 //        {
 //      }
 public frm_Click2Mail(XmlDocument xml, string file, mode m, string username, string pw, SetupStationaryFields caller)
 {
     frm = caller;
     // This call is required by the designer.
     InitializeComponent();
     if (m == mode.live) {
     _url = _Lmainurl;
     } else {
     _url = _Smainurl;
     }
     _authinfo = username + ":" + pw;
     _XMLDOC = xml;
     _file = file;
     // Add any initialization after the InitializeComponent() call.
 }
Example #8
0
        public FormListeJoueurs(mode mMode)
        {
            InitializeComponent();

            if (mMode == mode.selection)
            {
                btnSupprimer.Text = "Assigner";
                btnSupprimer.Click -= btnSupprimer_Click;
                btnSupprimer.Click += btnAssigner_Click;
                btnSupprimer.Image = ((System.Drawing.Image)(Properties.Resources.Apply));
                btnAjouter.Visible = false;
                btnModifier.Visible = false;
                lsvJoueurs.MultiSelect = true;
            }
        }
Example #9
0
        public frmGrid(mode inputmode, List<GridItem> items)
        {
            InitializeComponent();
            Inputmode = inputmode;

            if (items != null)
            {
                GridItems = items;
            }
            else
            {
                GridItems = new List<GridItem>();

            }
            dgGrid.ItemsSource = GridItems;
        }
Example #10
0
    //-------------------
    // DESTROYED - DEATH
    //-------------------
    void Do_Destroy_Mode()
    {
        sfx.Play_One_Shot_Particle(2, bigExplosionPosition);                 // Play a bigger Explosion with Blast wave
        sfx.Make_Metal_Debris(transform.position);
        pointsScript.Activate_Points_Label(transform.position, pointsValue); // SHOW POINTS
        sceneManagerScript.Permanently_Destroy_GameObject(this.gameObject);

        bigExplosionPosition = Vector3.zero;
        state           = mode.passive;
        dataSynch       = false;
        damageDelayList = null;
        hitPositionList = null;
        damageList      = null;
        damageDelayList = new List <float>();   // Delay before bullet arrives from Raycast
        damageList      = new List <int>();     // Damage assigned from the Input script
        hitPositionList = new List <Vector3>(); // Vector assigned from the Input script
    }
Example #11
0
        public bool powerdown(mode m)
        {
            //Envoie de la commande pour arrêter les moteurs en mode drive ou Turn
            String commande;
            bool   retour = false;

            byte[] buffer = new byte[100];

            if (m_port.IsOpen)
            {
                commande = m.ToString() + ",powerdown\r\n";
                buffer   = System.Text.Encoding.UTF8.GetBytes(commande);
                m_port.Write(buffer, 0, commande.Length);
                retour = true;
            }
            return(retour);
        }
Example #12
0
        public FormCustomer(mode mode = mode.nomal)
        {
            InitializeComponent();

            this.formMode = mode;
            if (formMode == mode.select)
            {
                ReturnCustumerID   = -1;
                ReturnCustumerName = "";
                btnSelect.Show();
            }

            ConfigDataGridView();
            sqlHelper = new SqlHelper();
            control   = new ControlHelper();
            CustomerHelpers.ConfigSearch(cbFields);
        }
Example #13
0
        private static void DisplayLog(mode mode, string message)
        {
            switch (mode)
            {
            case mode.normal:
                Debug.Log(message);
                break;

            case mode.error:
                Debug.LogError(message);
                break;

            case mode.warning:
                Debug.LogWarning(message);
                break;
            }
        }
Example #14
0
        public bool start(mode m)
        {
            String commande;

            byte[] buffer = new byte[100];
            bool   retour = false;

            buffer[0] = (byte)m;
            commande  = BitConverter.ToChar(buffer, 0).ToString() + ",start\r\n";
            buffer    = System.Text.Encoding.UTF8.GetBytes(commande);
            if (m_port.IsOpen)
            {
                m_port.Write(buffer, 0, commande.Length);
                retour = true;
            }
            return(retour);
        }
    //-------------------
    // DAMAGE UPDATER
    //-------------------
    public void Calculate_Damage(int damage)
    {
        //Damage Saved from inputs script..gets set when raycast hits something
        health = (health - (damage - armour));



        // UPDATE SCENE MANAGER ARRAY DATA
        sceneManagerScript.Update_GameObject_Health_OnHit(this.gameObject, health);



        if (health < 0)
        {
            state = mode.destroyed;
        }
    }
Example #16
0
 public void GoConnectMode(Box box, mode mode)
 {
     currentConnectBox = box;
     currentMode       = mode;
     if (mode == mode.connectPrent)
     {
         foreach (var bw in this.boxWindows)
         {
             if (bw.box == box)
             {
                 continue;
             }
             if (bw.box.programId != box.programId && bw.box.adaptBoxTags.Contains(box.tag))
             {
                 bw.SetColor(positiveColor);
                 bw.connectModeFlag = true;
             }
             else
             {
                 bw.SetColor(negativeColor);
                 bw.connectModeFlag = false;
             }
         }
     }
     else if (mode == mode.connectchild)
     {
         foreach (var bw in this.boxWindows)
         {
             if (bw.box == box)
             {
                 continue;
             }
             if (bw.box.programId != box.programId && box.adaptBoxTags.Contains(bw.box.tag))
             {
                 bw.SetColor(positiveColor);
                 bw.connectModeFlag = true;
             }
             else
             {
                 bw.SetColor(negativeColor);
                 bw.connectModeFlag = false;
             }
         }
     }
 }
        //public frm_Click2Mail()
//        {

        //      }

        public frm_Click2Mail(XmlDocument xml, string file, mode m, string username, string pw, SetupStationaryFields caller)
        {
            frm = caller;
            // This call is required by the designer.
            InitializeComponent();
            if (m == mode.live)
            {
                _url = _Lmainurl;
            }
            else
            {
                _url = _Smainurl;
            }
            _authinfo = username + ":" + pw;
            _XMLDOC   = xml;
            _file     = file;
            // Add any initialization after the InitializeComponent() call.
        }
Example #18
0
        public static void writeToDb(DBObject bObject, mode bMode)
        {
            using (var db = new LiteDatabase(dbName))
            {
                switch (bMode)
                {
                case mode.Insert:
                    //person:
                    if (bObject is Person)
                    {
                        var rec = db.GetCollection <Person>(Person.CollectionName);
                        rec.Insert((Person)bObject);
                    }

                    break;
                }
            }
        }
Example #19
0
        /// <summary>
        /// Return informations about a replay.
        /// </summary>
        /// <param name="_m">The mode the score was played in.</param>
        /// <param name="_b">The beatmap ID (not beatmap set ID!) in which the replay was played.</param>
        /// <param name="_u">The user that has played the beatmap.</param>
        /// <param name="_mods">Specify a mod or mod combination (.</param>
        /// <returns>Fetch replay data.</returns>
        public OsuReplay GetReplay(mode _m, long _b, string _u, long?_mods)
        {
            string replay = str.Replay(_m, _b, _u);

            if (_mods != null)
            {
                replay = replay + "&mods=" + _mods;
            }
            OsuReplay obj;
            string    html = utl.GetUrl(replay);

            obj = JsonConvert.DeserializeObject <OsuReplay>(html);
            utl.ErrorHandler(obj);

            return(obj);
            // Note that the binary data you get when you decode above base64-string, is not the contents of an.osr-file.It is the LZMA stream referred to by the osu-wiki here:
            // The remaining data contains information about mouse movement and key presses in an wikipedia:LZMA stream(https://osu.ppy.sh/wiki/Osr_(file_format)#Format)
        }
    //-------------------
    // START... REMEMBER - A RE-USED POOL OBJECT CALLS START() EACH TIME - so any relevant individual values need setting here & not in Awake()
    //-------------------
    void Start()
    {
        dataSynch = false;

        state = mode.passive;

        bigExplosionPosition = Vector3.zero; //Final Death Big explosion trigger

        Get_Prefab_Pointers();

        turnRate = Random.Range(40f, 60f);

        //hinge.Rotate(Vector3.up * (int)Random.Range(0f, 355f));

        turret.eulerAngles = new Vector3((int)Random.Range(-5f, -15f), turret.eulerAngles.y, turret.eulerAngles.z);

        state = mode.attack;
    }
Example #21
0
 /// <summary>
 /// Detects which mode to use.
 /// </summary>
 protected void DetectMode() //might just do 'return'
 {
     if (!modeSet)
     {
         if (gameObject.transform.parent != null)
         {
             if (gameObject.transform.parent.CompareTag("Rope"))
             {
                 currentMode = mode.Rope;
             }
         }
         else
         {
             currentMode = mode.Hook;
         }
         modeSet = true;
     }
 }
Example #22
0
        public bool start(mode m)
        {
            //Envoie de la commande Start précédée du mode (Drive ou Turn)
            //Obligatoire ?envoyer avant chaque commande !
            String commande;

            byte[] buffer = new byte[100];
            bool   retour = false;

            buffer[0] = (byte)m;
            commande  = BitConverter.ToChar(buffer, 0).ToString() + ",start\r\n";
            buffer    = System.Text.Encoding.UTF8.GetBytes(commande);
            if (m_port.IsOpen)
            {
                m_port.Write(buffer, 0, commande.Length);
                retour = true;
            }
            return(retour);
        }
Example #23
0
        public NetConn(callBack cb, string _IP, int _PORT, mode _MODE)
        {
            netMode = _MODE;
            IP      = _IP;
            port    = _PORT;

            if (netMode == mode.HOST)
            {
                _server = new NetServer(IP, port);
                _server.setPWrp(pw);
                _server.StartServer(cb);
            }
            else
            {
                _client = new NetClient(IP, port);
                _client.setPWrp(pw);
                _client.startConnection();
            }
        }
 public void Load(DataTable dtDepartments, DataTable dtGroups, DataTable dtAssociates, DataTable dtClaimsCenterLimits, DataTable dtDataHavenLimits)
 {
     cbDepartment.ItemsSource   = dtDepartments.DefaultView;
     cbGroup.ItemsSource        = dtGroups.DefaultView;
     txtFirst.Text              = "";
     txtLast.Text               = "";
     txtTicket.Text             = "";
     cbDepartment.SelectedIndex = -1;
     cbGroup.SelectedIndex      = -1;
     dtAssoc                       = dtAssociates;
     eMode                         = mode.add;
     lblTitle.Text                 = "Add Associate";
     btnSave.Content               = "Save";
     txtFirst.IsReadOnly           = txtLast.IsReadOnly = cbDepartment.IsReadOnly = cbGroup.IsReadOnly = false;
     cbDepartment.IsHitTestVisible = cbGroup.IsHitTestVisible = true;
     hideTicketInfo(hide: true);
     fillCCID(dtClaimsCenterLimits);
     fillDHID(dtDataHavenLimits);
 }
Example #25
0
    //-------------------
    //ATTACK BEHAVIOUR & ANIMATION
    //-------------------

    void Do_Attack_Mode()
    {
        //--------------
        if (Time.time > animTime) // This swaps between a 'Kneel Shoot' and a 'Stand Shoot'

        {
            animTime = Time.time + Random.Range(2f, 5f);

            FRAME_ARRAY[currentFrame].renderer.enabled = false; // Hide current frame;

            currentFrame = Random.Range(6, 8);                  // Choose new random pose

            FRAME_ARRAY[currentFrame].renderer.enabled = true;  // Show the mesh frame

            FRAME_ARRAY[0].renderer.enabled = false;            // Hide Muzzle flashes to be safe
            FRAME_ARRAY[1].renderer.enabled = false;
        }


        //--------------
        locked = Track_Target();

        //--------------
        if (targetDistance < attackRadius)
        {
            if (locked)
            {
                if (Time.time > reloadTimer)
                {
                    reloadTimer = Time.time + Random.Range(0.3f, 1.2f);

                    reload = (!reload);
                }

                DoShooting();
            }
        }

        else
        {
            state = mode.passive;
        }
    }
Example #26
0
            /*-------------------------------------------------------------------------
             *
             * ---------------------------------------------------------------------------*/
            public window(d3d_device device, Vector2 pos, Vector2 size, float z)
            {
                m_device = device;
                m_pos    = pos;
                m_size   = size;
                m_z      = z;
                title    = "タイトル";

                m_back_color  = Color.FromArgb(180, 170, 170, 170).ToArgb();
                title_color   = Color.SkyBlue.ToArgb();
                m_frame_color = Color.Black.ToArgb();

                m_window_mode  = mode.normal;
                m_screen_size  = new Vector2(0, 0);
                is_draw_header = true;

                update_pos();
                update_size();
            }
 public Form2(mode MODE)
 {
     InitializeComponent();
     this.NextLabel.Location = new System.Drawing.Point(MODE.nextLabel_X(), MODE.nextLabel_Y());
     block_type      = (uint)rander.Next(0, 7) + 1;
     block_type_pre  = block_type;
     block_type_next = block_type;
     // generate 20x10 labels for "main" area, dynamically.
     for (int i = 0; i < 20; i++)
     {
         for (int j = 0; j < 10; j++)
         {
             grids[i, j]             = new Label();
             grids[i, j].Width       = 30;
             grids[i, j].Height      = 30;
             grids[i, j].BorderStyle = BorderStyle.FixedSingle;
             grids[i, j].BackColor   = Color.Black;
             grids[i, j].Left        = MODE.get_grids_Left() + 30 * j; //遊戲畫面的左右位置
             grids[i, j].Top         = 600 - i * 30;                   //遊戲畫面的上下位置
             grids[i, j].Visible     = true;
             this.Controls.Add(grids[i, j]);
         }
     }
     // generate 4x3 labels for "next" area, dynamically.
     for (int i = 0; i < 4; i++)
     {
         for (int j = 0; j < 3; j++)
         {
             next[i, j]             = new Label();
             next[i, j].Width       = 20;
             next[i, j].Height      = 20;
             next[i, j].BorderStyle = BorderStyle.FixedSingle;
             next[i, j].BackColor   = Color.White;
             next[i, j].Left        = MODE.get_next_Left() + 20 * j;
             next[i, j].Top         = MODE.get_next_Top() - i * 20;
             next[i, j].Visible     = true;
             this.Controls.Add(next[i, j]);
         }
     }
     // init variables of the game
     init_game();
 }
Example #28
0
        /// <summary>
        /// Get informations about a replay.
        /// </summary>
        /// <param name="_m">The mode the score was played in.</param>
        /// <param name="_b">The beatmap ID (not beatmap set ID!) in which the replay was played.</param>
        /// <param name="_u">The user that has played the beatmap.</param>
        /// <returns>Fetch replay data.</returns>
        public async Task <OsuReplay> GetReplay(mode _m, int _b, string _u)
        {
            OsuReplay obj;
            string    replay = str.Replay(_m, _b, _u);
            string    html   = await GetUrl(replay);

            obj = JsonConvert.DeserializeObject <OsuReplay>(html);
            if (obj.error == null)
            {
                obj.error = "none";
            }
            else
            {
                throw new Exception("Replay data not available: " + obj.error);
            }

            return(obj);
            // Note that the binary data you get when you decode above base64-string, is not the contents of an.osr-file.It is the LZMA stream referred to by the osu-wiki here:
            // The remaining data contains information about mouse movement and key presses in an wikipedia:LZMA stream(https://osu.ppy.sh/wiki/Osr_(file_format)#Format)
        }
Example #29
0
        //コンストラクタ
        public GameMain()
        {
            //変数の初期化
            this.key = new int[256];
            this.gameMode = mode.TITLE; //ゲームモードをゲームの新規開始にする

            //フォントの色とフォントの指定(ゲームクリア時に使用)
            this.fontType = DX.CreateFontToHandle(null, 64, 5, -1);
            this.white = DX.GetColor(255, 255, 255);

            //画面のキャラクターを読み込む
            this.stickbuf = DX.LoadGraph("gamedata\\stick.png");
            this.ballbuf = DX.LoadGraph("gamedata\\ball.png");
            this.wallbuf = DX.LoadGraph("gamedata\\wall.png");
            this.blockbuf = DX.LoadGraph("gamedata\\block.png");

            //ボールとスティックを作る
            this.ball = new Ball();
            this.stick = new Stick();
        }
Example #30
0
    public void UpdateVision(bool canSee, GameObject whatIsSeen)
    {
        if (canSee == true)
        {
            GameObject newPop = Instantiate(popUpText);
            newPop.transform.position             = this.transform.position;
            newPop.GetComponent <PopText>().owner = this;
            enemyState = mode.startled;
            moving     = false;
            isStartled = true;
            target     = whatIsSeen;
        }

        if (canSee == false)
        {
            moving     = true;
            speed      = patrolSpeed;
            enemyState = mode.patrol;
        }
    }
Example #31
0
        private void OnBottomNavigationItemClick(object sender, BottomNavigationView.NavigationItemSelectedEventArgs e)
        {
            switch (e.Item.ItemId)
            {
            case Resource.Id.bottomNav_exercises:
                ViewMode = mode.exercise;
                //Toast.MakeText(Application.Context, "exercise", ToastLength.Short).Show();
                break;

            case Resource.Id.bottomNav_trainings:
                //Toast.MakeText(Application.Context, "training", ToastLength.Short).Show();
                ViewMode = mode.training;
                break;

            case Resource.Id.bottomNav_plans:
                //Toast.MakeText(Application.Context, "plans", ToastLength.Short).Show();
                ViewMode = mode.plan;
                break;
            }
        }
Example #32
0
    //-------------------
    // OLD DAMAGE UPDATER
    //-------------------
    void Calculate_DamageOLD_NO_LONGER_USED()
    {
        if (inp.tapObject == this.transform)
        {
            //get from inputs script..gets set when raycast hits something
            health = (health - (inp.hitDamage - armour));
        }



        // UPDATE SCENE MANAGER ARRAY DATA
        sceneManagerScript.Update_GameObject_Health_OnHit(this.gameObject, health);



        if (health < 0)
        {
            state = mode.destroyed;
        }
    }
Example #33
0
    //-------------------
    // START... REMEMBER - A RE-USED POOL OBJECT CALLS START() EACH TIME - so any relevant individual values need setting here & not in Awake()
    //-------------------
    void Start()
    {
        dataSynch = false;

        state = mode.passive;

        bigExplosionPosition = Vector3.zero; //Final Death Big explosion trigger

        Get_Prefab_Pointers();

        turnRate = Random.Range(40f, 60f);

        hinge.Rotate(Vector3.up * (int)Random.Range(0f, 355f));

        // Reset Rapier missiles - troublesome things NEED MORE CODE!!
        foreach (Transform t in hinge.transform)
        {
            t.eulerAngles = new Vector3((int)Random.Range(-5f, -15f), t.eulerAngles.y, t.eulerAngles.z);
        }
    }
Example #34
0
        private void CreatePatientBut_Click(object sender, EventArgs e)
        {
            //try
            //{
            Patients pat = new Patients();

            LoadFormInPatient(pat);
            ctx.Patients.Add(pat);
            ctx.SaveChanges();
            MessageBox.Show("Пацієнта створено");
            patient = pat;
            m       = mode.Redact;
            Configure();
            //}
            //catch
            //{
            MessageBox.Show("Для створення нового пацієнта необхідно заповнити прізвище та ім'я");
            SurnameTB.Select();
            // }
        }
Example #35
0
    public void switchWeapon()
    {
        if (lastSwap > swapCd)
        {
            if (attackType == mode.shotgun)
            {
                attackType = mode.closeCombat;
                mistletoePrefab.transform.localScale = new Vector3(PlayerProgress.mistleSize, PlayerProgress.mistleSize, 0);
                mistletoe = (GameObject)Instantiate(mistletoePrefab, GameObject.Find("HandPosition").transform.position, gameObject.transform.rotation);
                mistletoe.transform.parent = this.gameObject.transform;
            }
            else if (attackType == mode.closeCombat)
            {
                attackType = mode.shotgun;
                GameObject.Destroy(mistletoe);
                mistletoe = null;
            }

            lastSwap = 0;
        }
    }
        private void btnThem_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            gcChitiet.Enabled         = true;
            gcProduct.Enabled         = false;
            btnThem.Enabled           = false;
            btnSua.Enabled            = false;
            btnXoa.Enabled            = false;
            btnGhi.Enabled            = true;
            tvCategories.Enabled      = false;
            ptbHinhsach.ImageLocation = "NotFound";

            txtTensach.Text               =
                txtMasach.Text            =
                    txtGiatien.Text       =
                        txtGioithieu.Text =
                            txtMota.Text  = "";
            tgsTinhtrang.IsOn             = false;
            txtTensach.Focus();

            status = mode.them;
        }
	void OnGUI() {
		// start the scroll view
		scrollPos = EditorGUILayout.BeginScrollView (scrollPos);

		// store if the GUI is enabled so we can restore it later
		bool guiEnabled = GUI.enabled;

		//Enum Drop Down Followed by fucntion that sets relative GUI elements
		bm = (mode) EditorGUI.EnumPopup ( EditorGUILayout.GetControlRect(), "Bundle Mode:", bm);
			setMode ();

		//Button to perform task
		if(GUI.Button(EditorGUILayout.GetControlRect(), "BUILD BUNDLES!"))
			performMode ();

		// restore the GUI
		GUI.enabled = guiEnabled;
		
		// close the scroll view
		EditorGUILayout.EndScrollView();
	} 
Example #38
0
        public void goToPos(URCoordinates goC, bool waitDone = false)
        {
            StreamWriter txt;

            txt = new StreamWriter("Pos//GoTo.pos", false);
            txt.WriteLine("position");

            txt.WriteLine(goC.ToPos());
            txt.Flush();
            txt.Close();

            ReadingFile = "Pos//GoTo.pos";
            cmd         = mode.moveByFile;
            if (waitDone)
            {
                while (cmd == mode.stop)
                {
                    ;
                }
            }
        }
Example #39
0
    //-------------------
    // START... REMEMBER - A RE-USED POOL OBJECT CALLS START() EACH TIME - so any relevant individual values need setting here & not in Awake()
    //-------------------

    void Start()
    {
        burst = 0; // Reset so sound plays immediately when shooting for the first time

        dataSynch = false;

        bigExplosionPosition = Vector3.zero; //Final Death Big explosion trigger

        state = mode.passive;

        if (projectile == null)
        {
            Get_Prefab_Pointers();
        }

        turnRate = Random.Range(40f, 60f);

        //hinge.Rotate(Vector3.up * (int)Random.Range(0f, 355f));

        turret.localEulerAngles = new Vector3((int)Random.Range(-5f, -25f), turret.localEulerAngles.y, turret.localEulerAngles.z);
    }
Example #40
0
    //-------------------
    // AWAKE
    //-------------------
    void Awake()
    {
        pointsValue = 850;

        armour = 15; // subtracted from any hit damage values this enemy may receive


        state = mode.passive;

        attackRadius = 260;

        GameObject tempObject = GameObject.Find("GunView");

        target = tempObject.transform;

        tempObject   = GameObject.Find("PlayerCamera");
        playerCamera = tempObject.GetComponent <Camera>();    //
        sfx          = tempObject.GetComponent <FXManager>(); //

        //Find and get INPUT MANAGER SCRIPT - Totally necessary :)
        tempObject = GameObject.Find("A_GameWrapper");
        inp        = tempObject.GetComponent <ScriptAInputManager>(); //

        tempObject         = GameObject.Find("A_Scene_Manager");
        sceneManagerScript = tempObject.GetComponent <ScriptASceneManager>(); // Access to 'LEVEL DATA[]'  file necessary

        // NGUI LABELS POOL
        //tempObject = GameObject.Find("A_Null_Labels");
        //pointsScript = tempObject.GetComponent<ScriptPointsManager>();


        // Get Turret hinge
        for (int i = 0; i < transform.childCount; i++)
        {
            Transform c = transform.GetChild(i); if (c.name == "hinge")
            {
                hinge = c;
            }
        }
    }
Example #41
0
        /* Vérifie le premier caractère de la commande et lance le bon mode */
        public void ParseCmd(string cmd)
        {
            switch (cmd[0])
            {
            case '*':
                BuyProduct(cmd);
                break;

            case '#':
                AddMoney(cmd);
                break;

            case 'A':
                if (test == mode.technician)
                {
                    AddItem(cmd);
                }
                break;

            case 'C':
                GiveMoney(cmd);
                break;

            case 'D':
                if (cmd[1] == 'D' && test == mode.user)
                {
                    test = mode.technician;
                    Display("Mode", "technicien");
                    timer1.Start();
                }

                else if (cmd[1] == 'D' && test == mode.technician)
                {
                    test = mode.user;
                    Display("Mode", "utilisateur");
                    timer1.Start();
                }
                break;
            }
        }
Example #42
0
        public frmMain()
        {
            InitializeComponent();

            drawingMode = mode.idle;

            FlightPath = new FlightPath();
            Geometry = new Geometry();

            //sets which server the Control will get its map from and what mode it will be in
            gMapMain.MapProvider = GMapProviders.GoogleSatelliteMap;
            gMapMain.Manager.Mode = AccessMode.ServerAndCache;

            //details for access to map servers through school proxy
            /*GMapProvider.WebProxy = WebRequest.GetSystemWebProxy();
            GMapProvider.WebProxy.Credentials = new NetworkCredential("daniel.mann2", "5t3v3n");   */

            gMapMain.SetPositionByKeywords("Gosford, Australia");

            //sets limits and initial value for zoom of map
            trBarZoom.Maximum = gMapMain.MaxZoom = iMaxZoom;
            trBarZoom.Minimum = gMapMain.MinZoom = iMinZoom;
            trBarZoom.Value = iStartZoom;
            gMapMain.Zoom = iStartZoom;

            //adds overlays to the map which markers paths and polygons can then be placed on
            MarkerOverlay = new GMapOverlay("Markers");
            PathOverlay = new GMapOverlay("Path");
            PolyOverlay = new GMapOverlay("Poly");
            gMapMain.Overlays.Add(MarkerOverlay);
            gMapMain.Overlays.Add(PathOverlay);
            gMapMain.Overlays.Add(PolyOverlay);

            //initializes lists of points used for paths and polygons
            lPointsPath = new List<PointLatLng>();
            lPointsPoly = new List<PointLatLng>();
            lPointsConvexHull = new List<PointLatLng>();
        }
Example #43
0
 public virtual void Update(EkkoCore core)
 {
     var check = core._menu.ComboMenu["TeamfiveCheckC"].Cast<Slider>().CurrentValue;
     var target = core.targetSelected.getTarget(check);
     if (target == null)
     {
         this.modeActive = mode.Normal;
         return;
     }
     if (core.Player.Distance(target)
         < core.Player.Distance(Prediction.Position.PredictUnitPosition(target, 1000)))
     {
         this.modeActive=mode.Chase;
     }
     else
     {
         this.modeActive = mode.Normal;
     }
     if (this.getNumTargetsRange((int)core.spells.R.Range, 3))
     {
         this.modeActive = mode.TeamFive;
     }
 }
        public ActionResult pvIndex(mode m )
        {
            ViewBag.mode = m;
            string pattern;
            if(User.IsInRole("Administrators"))
                 pattern="";
            else
                 pattern=User.Identity.Name;
            var obj = (from i in db.shipTo
                      orderby i.OrderDateTime descending
                      where  i.Tables.Waiters.login.Contains(pattern)
                      select i).AsEnumerable();
            if (m == mode.Active)
            {
                obj = obj.Where(o => !o.getOState.Descr.Contains("Доставлено") || !o.getPState.Descr.Contains("Оплачено"));
            }

            if (m == mode.Archive)
            {
                obj = obj.Where(o => o.getOState.Descr.Contains("Доставлено") && o.getPState.Descr.Contains("Оплачено"));
            }

            return View(obj);
        }
Example #45
0
 private void newToolStripMenuItem_Click(object sender, EventArgs e)
 {
     clearData();
     Mode = mode.newdata;
 }
			ents[i].setFileMode(mode);
Example #47
0
        /* Vérifie le premier caractère de la commande et lance le bon mode */
        public void ParseCmd(string cmd)
        {
            switch (cmd[0]) {
                case '*':
                    BuyProduct(cmd);
                    break;
                case '#':
                    AddMoney(cmd);
                    break;
                case 'A':
                    if (test == mode.technician)
                        AddItem(cmd);
                    break;
                case 'C':
                    GiveMoney(cmd);
                    break;
                case 'D':
                    if (cmd[1] == 'D' && test == mode.user)
                    {
                        test = mode.technician;
                        Display("Mode", "technicien");
                        timer1.Start();
                    }

                    else if (cmd[1] == 'D' && test == mode.technician)
                    {
                        test = mode.user;
                        Display("Mode", "utilisateur");
                        timer1.Start();
                    }
                        break;

            }
        }
Example #48
0
 private void endPoly()
 {
     //disables all buttons and textboxes necessary for creating a polygon
     //sets the correct drawing mode
     drawingMode = mode.idle;
     btnPolyBegin.Enabled = true;
     btnPolyEnd.Enabled = false;
     txbxLatPoly.Enabled = false;
     txbxLngPoly.Enabled = false;
     btnAddPolyPoint.Enabled = false;
     lPointsConvexHull = new List<PointLatLng>(lPointsPoly);
     Geometry.ConvexHull(lPointsConvexHull);
 }
Example #49
0
 public StockProduct()
 {
     InitializeComponent();
     txtProductName.ReadOnly = true;
     Mode = mode.newdata;
 }
Example #50
0
 private void beginPoly()
 {
     //enables all buttons and textboxes necessary for creating a path
     //sets the correct drawing mode
     drawingMode = mode.poly;
     btnPolyBegin.Enabled = false;
     btnPolyEnd.Enabled = true;
     txbxLatPoly.Enabled = true;
     txbxLngPoly.Enabled = true;
     btnAddPolyPoint.Enabled = true;
 }
Example #51
0
 private void endPath()
 {
     //disables all buttons and textboxes necessary for creating a path
     //sets the correct drawing mode
     drawingMode = mode.idle;
     btnPathBegin.Enabled = true;
     btnPathEnd.Enabled = false;
     txbxLatPath.Enabled = false;
     txbxLngPath.Enabled = false;
     btnAddPathPoint.Enabled = false;
 }
Example #52
0
 public void SelectMode()
 {
     switch(pressedKey)
     {
     case "a":
         activeMode = mode.Menu;
         playmodeParameter = null;
         activeParameter = 0;
         activeIndex = 0;
         break;
     case "b":
         if(activeMenu != menu.None)
         {
             activeMode = mode.Parameter;
             activeParameter = 0;
             playmodeParameter = playmodeParameters.Get(activeParameter);
             activeIndex = 0;
         }
         break;
     case "c":
         if(playmodeParameter.type == "Vector2" || playmodeParameter.type == "Vector3")
         {
             activeMode = mode.Index;
         }
         break;
     }
 }
Example #53
0
    public void Update()
    {
        if(flyStick != null)
        {
            if(flyStick.GetComponent<ControllerFlyStick>().go == gameObject)
            {
                //Check for input
                if(Input.inputString != "")
                {
                    pressedKey = Input.inputString;
                }

                //Select mode
                if(pressedKey == "a" || pressedKey == "b" || pressedKey == "c")
                {
                    SelectMode();
                    pressedKey = "";
                    return;
                }

                //Select menu / parameter / index
                if(activeMode != mode.None &&
                   (pressedKey == "l" || pressedKey == "r"))
                {
                    switch(activeMode)
                    {
                    case mode.Menu:
                        SelectMenu();
                        break;
                    case mode.Parameter:
                        SelectParameter();
                        break;
                    case mode.Index:
                        SelectIndex();
                        break;
                    }

                    pressedKey = "";
                    return;
                }

                //Change value
                if(activeMode != mode.None &&
                   activeMenu != menu.None &&
                   playmodeParameter != null &&
                   (pressedKey == "u" || pressedKey == "d"))
                {
                    switch(pressedKey)
                    {
                    case "u":
                        switch(playmodeParameter.type)
                        {
                        case "int":
                            IncreaseInt();
                            break;
                        case "Vector2":
                            IncreaseVector2();
                            break;
                        case "Vector3":
                            IncreaseVector3();
                            break;
                        }
                        break;
                    case "d":
                        switch(playmodeParameter.type)
                        {
                        case "int":
                            DecreaseInt();
                            break;
                        case "Vector2":
                            DecreaseVector2();
                            break;
                        case "Vector3":
                            DecreaseVector3();
                            break;
                        }
                        break;
                    }

                    pressedKey = "";
                    return;
                }
            }
            else
            {
                activeMode = mode.None;
                activeMenu = menu.None;
                activeParameter = 0;
                activeIndex = 0;
                playmodeParameter = null;
            }
        }
    }
        /// <summary>
        /// Load the category definitions.
        /// </summary>
        /// <returns>True if the file has been loaded; false otherwise.</returns>
        public static bool Load()
        {
            if (RunParameters.Instance.Options.Contains("WMCIMPORT"))
                currentMode = mode.wmc;
            else
            {
                if (RunParameters.Instance.Options.Contains("DVBVIEWERIMPORT") || RunParameters.Instance.Options.Contains("DVBVIEWERRECSVCIMPORT"))
                    currentMode = mode.dvbViewer;
                else
                {
                    if (CommandLine.PluginMode && !RunParameters.Instance.OutputFileSet)
                        currentMode = mode.dvbLogic;
                    else
                        currentMode = mode.native;
                }
            }

            string actualFileName = Path.Combine(RunParameters.DataDirectory, FileName + ".cfg");
            if (!File.Exists(actualFileName))
            {
                actualFileName = Path.Combine(RunParameters.ConfigDirectory, Path.Combine("Program Categories", FileName + ".cfg"));
                if (!File.Exists(actualFileName))
                    return (true);
            }

            return (Load(actualFileName));
        }
Example #55
0
    public void Initialize()
    {
        this.flyStick = GameObject.Find ("FlyStick");
        this.root = gameObject.transform.parent.gameObject.GetComponent<VTKRoot> ();

        this.filter = node.filter;
        this.properties = node.properties;

        activeMode = mode.None;
        activeMenu = menu.None;
        activeParameter = 0;
        activeIndex = 0;
        playmodeParameter = null;
    }
Example #56
0
 private void toolStripButtonpan_Click(object sender, EventArgs e)
 {
     currentmode = mode.panmode;
 }
Example #57
0
 static string GetHD(mode upMode)
 {
     switch (upMode)
     {
         case mode.detail: return "D";
         case mode.header: return "H";
         case mode.asyncHeader: return "H_Temp";
         case mode.asyncDetail: return "D_Temp";
         default: return "H";//non-reachable
     }
 }
Example #58
0
        public static result UploadAndSave(HttpPostedFileBase upFile, ref string docName, string ClaimGUID, int? DetailId, mode upMode)
        {
            #region Init variables

            string subsubDir = GetHD(upMode); bool hasDetail = (DetailId != null);
            result resultIO = result.emptyNoFile;

            string ext = Path.GetExtension(upFile.FileName);//Get extension
            docName = Path.GetFileNameWithoutExtension(upFile.FileName);//Get only file name

            #endregion

            #region Issue with file name/ path / extension

            if (upFile == null || string.IsNullOrEmpty(upFile.FileName) || upFile.ContentLength < 1)
                return resultIO;
            else if(string.IsNullOrEmpty(ext))
                //Security (review in future)http://www.dreamincode.net/code/snippet1796.htm
                //if (ext.ToLower() == "exe" || ext.ToLower() == "ddl")
                return result.noextension;

            #endregion

            try
            {
                if (upFile.ContentLength > Config.MaxFileSizMB*1024*1024)
                    return result.contentLength;
                else
                {
                    //Get full path
                    string fullPath = CheckOrCreateDirectory(Config.UploadPath, ClaimGUID, subsubDir);
                    //Special case for Details dir (check & create a claimID/D/detailID directory)
                    if (hasDetail) fullPath = CheckOrCreateDirectory(fullPath, DetailId.ToString());
                    // Gen doc name
                    docName = docName + ext;
                    // Check file duplication
                    if (//upMode != mode.asyncDetail && upMode != mode.asyncHeader &&
                        File.Exists(Path.Combine(fullPath, docName)))
                        return result.duplicate;//Duplicate file exists!

                    // All OK - so finally upload
                    upFile.SaveAs(Path.Combine(fullPath, docName));//Save or Overwrite the file
                }
            }
            catch { return result.fileUploadIssue; }

            return result.successful;
        }
Example #59
0
        public static string GetClaimFilePath(string ClaimGUID, int? ClaimDetailID, mode upMode, string FileName, bool webURL)
        {
            if (string.IsNullOrEmpty(ClaimGUID) || (string.IsNullOrEmpty(FileName) && webURL))
                return "#";

            string basePath = webURL ? Config.DownloadUrl : Config.UploadPath;
            char sep = (webURL ? webPathSep : dirPathSep);
            string dirPath = basePath + sep + ClaimGUID + sep + GetHD(upMode); // might be web url or physical path so can't use Path.Combine

            if (ClaimDetailID != null) //Special case for Details file
                dirPath = dirPath + sep + ClaimDetailID.Value.ToString();

            return string.IsNullOrEmpty(FileName) ? dirPath : dirPath + sep + FileName;
        }
Example #60
0
 private void toolStripButtonmovebox_Click(object sender, EventArgs e)
 {
     currentmode = mode.movebox;
 }