Пример #1
0
        private void btnMaxFlowPaths_Click(object sender, EventArgs e)
        {
            MyGraph myGraph       = InputControls.getMyGraph();
            var     pathList      = myGraph.getAllPaths();
            var     maxFlowList   = new List <int>();
            var     isMaxFlowList = new List <bool>();

            for (int i = 0; i < pathList.Count(); i++)
            {
                int maxFlow = myGraph.getMaxFlowOfPath(pathList[i]);
                maxFlowList.Add(maxFlow);
            }

            int maxFlowNum = maxFlowList.Max();

            foreach (var maxFlow in maxFlowList)
            {
                if (maxFlow == maxFlowNum)
                {
                    isMaxFlowList.Add(true);
                }
                else
                {
                    isMaxFlowList.Add(false);
                }
            }

            for (int i = 0; i < pathList.Count(); i++)
            {
                FormGraph formGraph = new FormGraph(pathList[i], isMaxFlowList[i] /*, maxFlowList[i]*/);
                formGraph.Text = "Net Flow: " + maxFlowList[i].ToString();
                formGraph.Show();
            }
        }
        private void LoadItems()
        {
            ItemDataCollection = new RoleCollection();
            ItemDataCollection.LoadAllItems();

            InputControls.LoadToComboBox(cboRole, ItemDataCollection.Items);
        }
Пример #3
0
        private void LoadRoles()
        {
            var roleReader = new RoleDataReader();
            var roles      = roleReader.GetAllRoleNames();

            InputControls.LoadToComboBox(cboRole, roles);
        }
Пример #4
0
        private void Awake()
        {
            _controls = new InputControls();
            _controls.Move.SetCallbacks(this);

            _controls.Enable();
        }
Пример #5
0
    private void Keymapping()
    {
        //Keymapping
        showKeymappingVariables = EditorGUILayout.BeginFoldoutHeaderGroup(showKeymappingVariables, "Keymapping");

        if (showKeymappingVariables)
        {
            EditorGUILayout.BeginHorizontal();
            GUILayout.Label("Placing", EditorStyles.label);
            GUILayout.FlexibleSpace();
            button1 = InputControls.KeyCodeFieldLayout(button1);
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            GUILayout.Label("Removing", EditorStyles.label);
            GUILayout.FlexibleSpace();
            button2 = InputControls.KeyCodeFieldLayout(button2);
            EditorGUILayout.EndHorizontal();
        }

        EditorGUILayout.EndFoldoutHeaderGroup();

        MouseHelper.button1Code = button1;
        MouseHelper.button2Code = button2;
    }
Пример #6
0
    void Start()
    {
        inputControls = GameObject.FindWithTag("Player").GetComponent <InputControls>();
        playerHook    = GameObject.FindWithTag("Player").GetComponent <PlayerHook>();

        mat = GetComponent <Renderer>().material;
    }
Пример #7
0
        public frmContacts_Add()
        {
            InitializeComponent();

            #region Initialize DirtyHandler

            DirtyStatus = new DirtyFormHandler(this);

            this.AskToSaveOnDirtyClosing();
            this.ConvertEnterToTab();
            Load += (s, e) =>
            {
                ShowData();
                DirtyStatus.Clear();
            };

            #endregion


            InputControls.LoadToComboBox(cboCountry, InputControls.Address.GetCountryList().OrderBy(_ => _));
            cboCountry.SelectedIndexChanged += CboCountry_SelectedIndexChanged;

            InputControls.Address.LoadProvinceListTo(cboProvince);
            cboProvince.SelectedIndexChanged += cboProvince_SelectedIndexChanged;


            RecordInfoPanel.Groups[0].ItemAlignment = eItemAlignment.Far;
        }
Пример #8
0
 /// <param name="trkDef">The target trk</param>
 /// <param name="inputControls">If non-null, this inputControls overrrides the InputControls in the InputNote or InputChord</param>
 public TrkOn(TrkDef trkDef, InputControls inputControls)
 {
     _trkMidiChannel = trkDef.MidiChannel;
     _trkMsPosition = trkDef.StartMsPosition;
     _trkNumMidiObjects = trkDef.DurationsCount; // includes MidiChordDef, RestDef
     _inputControls = inputControls;
 }
Пример #9
0
 private void Awake()
 {
     inputControls   = new InputControls();
     playerRigidbody = GetComponent <Rigidbody>();
     healthComp      = GetComponent <HealthComponent>();
     audioSource     = GetComponent <AudioSource>();
 }
Пример #10
0
 /// <param name="trkDef">The target trk's midi channel</param>
 /// <param name="trkStartPosition">The target trk's startMsPosition</param>
 /// <param name="trkNumMidiObjects">The number of MidiChordDefs and RestDefs in the target trk.</param>
 /// <param name="inputControls">If non-null, this inputControls overrrides the InputControls in the InputNote or InputChord</param>
 public TrkOn(byte trkMidiChannel, int trkStartPosition, int trkNumMidiObjects, InputControls inputControls)
 {
     _trkMidiChannel = trkMidiChannel;
     _trkMsPosition = trkStartPosition;
     _trkNumMidiObjects = trkNumMidiObjects;
     _inputControls = inputControls;
 }
Пример #11
0
 void Awake()
 {
     ctrl = new InputControls();
     ctrl.Movement.SetCallbacks(this);
     ctrl.Shooting.SetCallbacks(this);
     rb = GetComponent <Rigidbody2D>();
 }
Пример #12
0
 public PrivateControlModule(InputControls inputControls, ISystemControl systemControl, IAmplifier amplifier, IDisposable disposer)
 {
     this.Amplifier     = amplifier;
     this.SystemControl = systemControl;
     this.InputControls = inputControls;
     this.Disposer      = disposer;
 }
        /// <summary>
        /// Constructor
        /// </summary>
        public ChainInputPanelControl()
        {
            InitializeComponent();

            ComboSymbolActions.ItemsSource    = SymbolActions;
            SymbolInputsContainer.ItemsSource = InputControls;

            CommandService.Events.Subscribe((message) =>
            {
                if (Equals(message.Entity, EntityEnum.Chain))
                {
                    var inputControl = message.Content as ChainInputControl;

                    switch (message.Action)
                    {
                    case ActionEnum.Create:

                        InputControls.Add(new ChainInputControl {
                            Margin = new Thickness(0, 0, 0, 15)
                        });
                        break;

                    case ActionEnum.Delete:

                        if (InputControls.Count > 1)
                        {
                            InputControls.Remove(inputControl);
                        }

                        break;
                    }
                }
            });
        }
Пример #14
0
    private void Awake()
    {
        basePauseMenuRect = basePauseMenu.GetComponent <RectTransform>();
        basePauseMenuRect.localPosition = new Vector3(0f, -600f, 0f);

        inputControls = new InputControls();
    }
Пример #15
0
        private void ShowData()
        {
            if (ItemData.Id != 0)
            {
                txtId.Text = ItemData.Id.ToString("0000");
            }

            txtLastname.Text      = ItemData.Name.Lastname;
            txtFirstname.Text     = ItemData.Name.Firstname;
            txtMiddlename.Text    = ItemData.Name.Middlename;
            txtMi.Text            = ItemData.Name.MiddleInitial;
            cboNameExtension.Text = ItemData.Name.NameExtension;

            txtMaidenMiddlename.Text = ItemData.Name.MaidenMiddlename;

            cboGender.Text    = ItemData.Gender == GenderType.Male ? "Male" : "Female";
            dtBirthdate.Value = ItemData.BirthDate;

            cboCountry.Text  = ItemData.BirthCountry;
            cboProvince.Text = ItemData.BirthProvince;
            cboTown.Text     = ItemData.BirthTown;


            txtImageFile.Text = ItemData.CameraCounter;


            //Mobile Numbers
            ItemData.MobileNumbers.LoadItemsFromDb();
            Show_MobileNumbers();

            //Show Picture
            InputControls.LoadImage(picImage, ItemData.CameraCounter);

            ShowFileInfo(ItemData);
        }
        private void Load_Positions()
        {
            var items = new PositionSalaryGradeCollection();

            items.LoadLatestSchedule();

            InputControls.LoadToComboBox(cboPosition, items.Items);
        }
        private void Load_Tax()
        {
            var items = new TaxCollection();

            items.LoadItemsFromDb();

            InputControls.LoadToComboBox(cboTax, items.Items);
        }
Пример #18
0
        private void OnEnable()
        {
            CheckpointZone.checkpointChangeEvent += ChangeCheckpoint;

            InputControls inputControls = new InputControls();

            inputControls.Enable();
        }
Пример #19
0
 private void lblVersion_DoubleClick(object sender, EventArgs e)
 {
     if (_buttonPress)
     {
         _buttonPress = false;
         MessageBoxEx.Show(this, InputControls.RenderDisplay(), "Application", MessageBoxButtons.OK,
                           MessageBoxIcon.Information);
     }
 }
Пример #20
0
        private void BtnUserAccounts_Click(object sender, EventArgs e)
        {
            if (!InputControls.UserCanAccess(this, "SysAdmin"))
            {
                return;
            }

            OpenForm(new frmAccounts(), "User Account Management");
        }
Пример #21
0
        public virtual IHtmlContent GetInputControl(InputControls cont)
        {
            InputModel.Attributes += AddInputControlAttributes();
            InputModel.Attributes += RazorUtils.ToAttributeString(InputModel.AttributeObject);
            InputModel.Attributes += RazorUtils.ToAttributeStringDynamic(InputModelExtraAttrs);
            string template = Helper.GetTheme().GetInputControl(cont);

            return(Partial(template, InputModel));
        }
Пример #22
0
        private void IOnPlayerInput(uLink.NetworkPlayer player, InputControls input)
        {
            PlayerSession session = Player.Find(player);

            if (session != null)
            {
                Interface.CallHook("OnPlayerInput", session, input);
            }
        }
        private void Awake()
        {
            playerRigidbody = GetComponent <Rigidbody>();
            cam             = FindObjectOfType <Camera>();

            inputControls = new InputControls();
            healthComp    = GetComponent <HealthComponent>();
            audioSource   = GetComponent <AudioSource>();
        }
Пример #24
0
    private void Awake()
    {
        //REF:
        camT     = GameObject.FindGameObjectWithTag("PlayerCam").transform;
        controls = new InputControls();
        rb       = GetComponent <Rigidbody>();

        //Functions:
        InputActions();
    }
Пример #25
0
    public InputManager()
    {
        input = new InputControls();
        input.Player.Enable();

        P_LeftClick     = input.Player.LeftClick;
        P_RightClick    = input.Player.RightClick;
        P_MouseDelta    = input.Player.MouseDelta;
        P_MousePosition = input.Player.MousePosition;
    }
Пример #26
0
    private void Awake()
    {
        Instance = this;

        InputControls = new InputControls();

        InputControls.Enable();

        ToggleCursor();
    }
Пример #27
0
    private void Awake()
    {
        mainMenuRect = mainMenu.GetComponent <RectTransform>();
        mainMenuRect.localPosition = new Vector3(0f, -600f, 0f);

        inputControls = new InputControls();

        Cursor.lockState = CursorLockMode.Confined;
        Cursor.visible   = true;
    }
Пример #28
0
    private void Awake()
    {
        //REF:
        camT           = GameObject.FindGameObjectWithTag("PlayerCam").transform;
        controls       = new InputControls();
        charController = GetComponent <CharacterController>();

        //Functions:
        InputActions();
    }
Пример #29
0
        public string GetControlGroupTemplate(InputControls type, bool localizable = false)
        {
            var index = "E__" + type.ToString() + (localizable ? "__LOC" : "");

            if (_controlTemplates.TryGetValue(index, out string t))
            {
                return(t);
            }
            return(DefaultControlGroupTemplate);
        }
Пример #30
0
        private void OnEnable()
        {
            PlaymodeManager.changeCameraTarget += SetCameraTarget;

            InputControls inputControls = new InputControls();

            inputControls.Camera.Rotate.performed += context => Rotate(context.ReadValue <Vector2>());

            inputControls.Enable();
        }
Пример #31
0
 private void SetBar4FadeControls(List <InputChordDef> bar4InputChordDefs)
 {
     foreach (InputChordDef inputChordDef in bar4InputChordDefs)
     {
         InputControls ics = new InputControls();
         ics.TrkOffOption     = TrkOffOption.fade;
         ics.PitchWheelOption = ControllerType.pitchWheel;
         inputChordDef.InputNoteDefs[0].InputControls = ics;
     }
 }
Пример #32
0
        private InputControls controls;      // Ref to the controls input that we are using for the project

        // Activates all of the controls for the player
        private void Awake()
        {
            // We need to first set this to be a new object before we can do anything
            controls = new InputControls();

            // Then we can set up calllbacks to specific methods that we want the controls to listen to
            controls.Player_Platform.PuzzleModeToggle.performed += ctx => ToggleMode(ctx);

            controls.Player_Puzzle.HardReset.performed += ctx => HardResetPuzzle(ctx);
        }
Пример #33
0
 /// <summary>
 /// This constructs an InputNoteDef that, when the noteOff arrives, turns off all the trks it has turned on. 
 /// </summary>
 /// <param name="notatedMidiPitch">In range 0..127</param>
 /// <param name="noteOnSeqDefs">Must contain at least one SeqDef</param>
 /// <param name="pressures">Can be null or empty</param>
 /// <param name="inputControls">Can be null</param>
 public InputNoteDef(byte notatedMidiPitch, TrkOns noteOnSeqDef, Pressures pressures, InputControls inputControls)
     : this(notatedMidiPitch, noteOnSeqDef, null, pressures, null, null, inputControls)
 {
     Debug.Assert(noteOnSeqDef != null);
     List<TrkOff> trkOffs = new List<TrkOff>();
     foreach(TrkOn trkOn in NoteOnTrkOns)
     {
         TrkOff trkOff = new TrkOff(trkOn.TrkMidiChannel, trkOn.TrkMsPosition, inputControls);
         trkOffs.Add(trkOff);
     }
     NoteOffTrkOffs = new TrkOffs(trkOffs, null);
 }
Пример #34
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="notatedMidiPitch">In range 0..127</param>
        /// <param name="noteOnTrkOns">Can be null or empty</param>
        /// <param name="noteOnTrkOffs">Can be null or empty</param>
        /// <param name="pressures">Can be null or empty</param>
        /// <param name="noteOffTrkOns">Can be null or empty</param>
        /// <param name="noteOffTrkOffs">Can be null or empty</param>
        /// <param name="inputControls">Can be null</param>
        public InputNoteDef(byte notatedMidiPitch,
							TrkOns noteOnTrkOns, TrkOffs noteOnTrkOffs,
							Pressures pressures,
							TrkOns noteOffTrkOns, TrkOffs noteOffTrkOffs,
							InputControls inputControls)
        {
            Debug.Assert(notatedMidiPitch >= 0 && notatedMidiPitch <= 127);
            // If inputControls is null, the higher level inputControls are used.

            NotatedMidiPitch = notatedMidiPitch;
            NoteOnTrkOns = noteOnTrkOns;
            NoteOnTrkOffs = noteOnTrkOffs;
            NotePressures = pressures;
            NoteOffTrkOns = noteOffTrkOns;
            NoteOffTrkOffs = noteOffTrkOffs;
            InputControls = inputControls;
        }
Пример #35
0
 private void IOnPlayerInput(uLink.NetworkPlayer player, InputControls input) => Interface.Call("OnPlayerInput", FindSessionByNetPlayer(player), input);
Пример #36
0
 /// <param name="trkOffs"></param>
 /// <param name="inputControls">Can be null</param>
 public TrkOffs(List<TrkOff> trkOffs, InputControls inputControls)
 {
     Debug.Assert(trkOffs != null && trkOffs.Count > 0);
     _inputControls = inputControls;
     _trkOffs = trkOffs;
 }
Пример #37
0
 /// <param name="trkMidiChannel">The midi channel of the Trk to be sent a trkOff message</param>
 /// <param name="trkMsPosition">The msPosition (in the score) of the Trk to be sent a trkOff message</param>
 /// <param name="inputControls">Can be null</param>
 public TrkOff(byte trkMidiChannel, int trkMsPosition, InputControls inputControls)
 {
     _midiChannel = trkMidiChannel;
     _trkMsPosition = trkMsPosition;
     _inputControls = inputControls;
 }
Пример #38
0
 /// <param name="midiChannel">The midi channel of the Track to be sent a pressure message</param>
 /// <param name="inputControls">Can be null</param>
 public Pressure(byte midiChannel, InputControls inputControls)
 {
     _midiChannel = midiChannel;
     _inputControls = inputControls;
 }
Пример #39
0
 /// <param name="trkOns"></param>
 /// <param name="inputControls">Can be null</param>
 public TrkOns(List<TrkOn> trkOns, InputControls inputControls)
 {
     Debug.Assert(trkOns != null && trkOns.Count > 0);
     _inputControls = inputControls;
     _trkOns = trkOns;
 }
Пример #40
0
 /// <param name="pressures"></param>
 /// <param name="inputControls">Can be null</param>
 public Pressures(List<Pressure> pressures, InputControls inputControls)
 {
     Debug.Assert(pressures != null && pressures.Count > 0);
     _inputControls = inputControls;
     _pressures = pressures;
 }
Пример #41
0
 private void IOnPlayerInput(uLink.NetworkPlayer player, InputControls input)
 {
     var identity = GameManager.Instance.GetIdentity(player);
     Interface.Oxide.CallHook("OnPlayerInput", identity.ConnectedSession, input);
 }
Пример #42
0
        List<VoiceDef> CreateBar1()
        {
            List<VoiceDef> bar = new List<VoiceDef>();

            byte channel = 0;
            foreach(Palette palette in _palettes)
            {
                TrkDef trkDef = new TrkDef(channel, new List<IUniqueDef>());
                bar.Add(trkDef);
                WriteVoiceMidiDurationDefs1(trkDef, palette);
                ++channel;
            }

            InputVoiceDef inputVoiceDef = new InputVoiceDef();
            VoiceDef bottomOutputVoice = bar[0];

            foreach(IUniqueDef iud in bottomOutputVoice.UniqueDefs)
            {
                MidiChordDef mcd = iud as MidiChordDef;
                RestDef rd = iud as RestDef;
                if(mcd != null)
                {
                    List<IUniqueDef> iuds = new List<IUniqueDef>() { (IUniqueDef)mcd };

                    // Note that the msPosition of the trkDef is trkDef.StartMsPosition (= iuds[0].msPosition),
                    // which may be greater than the InputChordDef's msPosition
                    TrkDef trkDef = new TrkDef(bottomOutputVoice.MidiChannel, iuds);

                    // If non-null, arg2 overrides the inputControls attached to the InputNote or InputChord.
                    TrkOn trkRef = new TrkOn(trkDef, null);
                    List<TrkOn> trkRefs = new List<TrkOn>() { trkRef };
                    TrkOns trkOns = new TrkOns(trkRefs, null);

                    byte displayPitch = (byte)(mcd.NotatedMidiPitches[0] + 36);
                    Pressure pressure = new Pressure(0, null);
                    Pressures pressures = new Pressures(new List<Pressure>() {pressure}, null);
                    TrkOff trkOff = new TrkOff(trkRef.TrkMidiChannel, mcd.MsPosition, null);
                    List<TrkOff> noteOffTrkOffs = new List<TrkOff>() { trkOff };
                    TrkOffs trkOffs = new TrkOffs(noteOffTrkOffs, null);

                    InputNoteDef inputNoteDef = new InputNoteDef(displayPitch,
                                                                    trkOns, null,
                                                                    pressures,
                                                                    null, trkOffs,
                                                                    null);

                    List<InputNoteDef> inputNoteDefs = new List<InputNoteDef>() { inputNoteDef };

                    // The InputChordDef's msPosition must be <= the msPosition of any of the contained trkRefs
                    InputChordDef icd = new InputChordDef(mcd.MsPosition, mcd.MsDuration, inputNoteDefs);

                    inputVoiceDef.UniqueDefs.Add(icd);
                }
                else if(rd != null)
                {
                    RestDef newRest = new RestDef(rd.MsPosition, rd.MsDuration);
                    inputVoiceDef.UniqueDefs.Add(newRest);
                }
            }

            #region set cascading inputControls on the first InputChordDef  (for testing)
            InputChordDef inputChordDef1 = inputVoiceDef.UniqueDefs[0] as InputChordDef; // no need to check for null here.

            InputControls chordInputControls = new InputControls();

            chordInputControls.VelocityOption = VelocityOption.overridden;
            chordInputControls.MinimumVelocity = 19;
            inputChordDef1.InputControls = chordInputControls;

            InputControls noteInputControls = new InputControls();
            noteInputControls.VelocityOption = VelocityOption.scaled;
            noteInputControls.MinimumVelocity = 20;
            inputChordDef1.InputNoteDefs[0].InputControls = noteInputControls;

            #endregion

            bar.Add(inputVoiceDef);

            return bar;
        }
Пример #43
0
        private void SetBar5SpeedControls(List<InputChordDef> bar5InputChordDefs)
        {
            foreach(InputChordDef inputChordDef in bar5InputChordDefs)
            {
                InputControls ics = new InputControls();

                ics.PitchWheelOption = ControllerType.pitchWheel; // this is the current value in the voice (has no effect)
                ics.SpeedOption = SpeedOption.noteOnKey;
                ics.MaxSpeedPercent = 500;
                inputChordDef.InputNoteDefs[0].InputControls = ics;
            }
        }
Пример #44
0
 private void SetBar4FadeControls(List<InputChordDef> bar4InputChordDefs)
 {
     foreach(InputChordDef inputChordDef in bar4InputChordDefs)
     {
         InputControls ics = new InputControls();
         ics.TrkOffOption = TrkOffOption.fade;
         ics.PitchWheelOption = ControllerType.pitchWheel;
         inputChordDef.InputNoteDefs[0].InputControls = ics;
     }
 }
Пример #45
0
 private void SetBar3PitchWheelToVolumeControls(List<InputChordDef> bar3InputChordDefs)
 {
     foreach(InputChordDef inputChordDef in bar3InputChordDefs)
     {
         InputControls ics = new InputControls();
         ics.TrkOffOption = TrkOffOption.fade; // this is the current value in the voice (has no effect)
         ics.PitchWheelOption = ControllerType.volume;
         ics.MaximumVolume = 100;
         ics.MinimumVolume = 50;
         inputChordDef.InputNoteDefs[0].InputControls = ics;
     }
 }
Пример #46
0
        private void SetBar2NoteOnNoteOffControls(List<InputChordDef> bar2InputChordDefs)
        {
            InputControls ics1 = new InputControls();
            ics1.TrkOffOption = TrkOffOption.stopChord;
            bar2InputChordDefs[0].InputNoteDefs[0].InputControls = ics1;

            InputControls ics2 = new InputControls();
            ics2.TrkOffOption = TrkOffOption.fade;
            bar2InputChordDefs[1].InputNoteDefs[0].InputControls = ics2;
        }