コード例 #1
0
ファイル: DBconection.cs プロジェクト: juanr35/RondaProject
    public void _sqlite()
    {
        Debug.Log("--------------------------");
        string        conn = "URI=file:" + Application.dataPath + "/Plugins/Ronda.db";
        IDbConnection dbconn;

        dbconn = (IDbConnection) new SqliteConnection(conn);
        dbconn.Open();

        string player1 = Input1.GetComponent <Text> ().text;
        string player2 = Input2.GetComponent <Text> ().text;

        //Guarda el nombre de los jugadores para poder usarlos en otra escena
        StaticPlayers.p1 = player1;
        StaticPlayers.p2 = player2;

        //Inserciones iniciales

        _InsertarJugador(player1, ref dbconn);
        _InsertarJugador(player2, ref dbconn);
        _InsertarMatchup(player1, player2, ref dbconn);
        _NuevaPartida(ref dbconn);
        _InsertarParticipacion(player1, ref dbconn);
        _InsertarParticipacion(player2, ref dbconn);

        dbconn.Close();
        dbconn = null;
    }
コード例 #2
0
 public BitwiseMux(int iSize) : base(iSize)
 {
     Control = new Wire();
     Control.ConnectOutput(this);
     Input1.ConnectOutput(this);
     Input2.ConnectOutput(this);
 }
コード例 #3
0
        public override double F(double x)
        {
            var a = base.F(x);
            var b = Input2.F(x);

            switch (Type)
            {
            case CombinationType.Add:
                return(a + b);

            case CombinationType.Substract:
                return(a - b);

            case CombinationType.Multiply:
                return(a * b);

            case CombinationType.Divide:
                // ReSharper disable once CompareOfFloatsByEqualityOperator
                if (b == 0.0)
                {
                    return(double.NaN);
                }
                return(a / b);

            default:
                return(double.NaN);
            }
        }
コード例 #4
0
 public DispatcherReactionPipelineStage(
     string name,
     Action <TInput1, TInput2, TInput3, TInput4, TInput5> reaction,
     Dispatcher dispatcher,
     IPipelineStage <TInput1> input1,
     IPipelineStage <TInput2> input2,
     IPipelineStage <TInput3> input3,
     IPipelineStage <TInput4> input4,
     IPipelineStage <TInput5> input5,
     bool reactImmediately)
 {
     Name       = name ?? throw new ArgumentNullException(nameof(name));
     Reaction   = reaction ?? throw new ArgumentNullException(nameof(reaction));
     Dispatcher = dispatcher ?? throw new ArgumentNullException(nameof(dispatcher));
     Input1     = input1 ?? throw new ArgumentNullException(nameof(input1));
     Input2     = input2 ?? throw new ArgumentNullException(nameof(input2));
     Input3     = input3 ?? throw new ArgumentNullException(nameof(input3));
     Input4     = input4 ?? throw new ArgumentNullException(nameof(input4));
     Input5     = input5 ?? throw new ArgumentNullException(nameof(input5));
     this.AddDependencies(input1, input2, input3, input4, input5);
     if (reactImmediately)
     {
         InvokeReaction(Input1.GetValue(), Input2.GetValue(), Input3.GetValue(), Input4.GetValue(), Input5.GetValue());
     }
 }
コード例 #5
0
    private void UpdateLog()
    {
        StringBuilder sb = new StringBuilder("version:" + bs.settings.version);

        if (!bs._Loader.ownSite)
        {
            sb.Append("a");
        }

        if (errorCount > 0)
        {
            sb.Append(" errors:" + errorCount);
        }
        if (isDebug)
        {
            sb.Append(" Debug");
        }
        if (isDebug && !online)
        {
            sb.Append(" offline");
        }

        LogScreen(sb.ToString());
        if (Input2.GetKey(android ? KeyCode.Alpha4 : KeyCode.F4) && Input2.GetKeyDown(android ? KeyCode.Alpha6 : KeyCode.F6))
        {
            consoleWindow.enabled = !consoleWindow.enabled;
        }
        //print(PhotonNetwork.connectionStateDetailed);
        sbuilder.Append(sbuilder2);
        if (log)
        {
            log.text = sbuilder.ToString();
        }
        sbuilder = new StringBuilder();
    }
コード例 #6
0
ファイル: MultiBitAdder.cs プロジェクト: LueeAkasha/ECS
        public override bool TestGate()
        {
            Input1.SetValue(7);
            Input2.SetValue(7);

            if (Output.Get2sComplement() != 14)
            {
                return(false);
            }

            Input1.Set2sComplement(6);
            Input2.Set2sComplement(-6);


            if (Output.Get2sComplement() != 0)
            {
                return(false);
            }

            Input1.Set2sComplement(6);
            Input2.Set2sComplement(-1);


            if (Output.Get2sComplement() != 5)
            {
                return(false);
            }

            return(true);
        }
コード例 #7
0
 /// <summary>
 /// Creates a new <see cref="ReactionPipelineStage"/> with the specified name and reaction to the specified inputs.
 /// </summary>
 /// <param name="name">The name of the new reaction.</param>
 /// <param name="reaction">The reaction delegate.</param>
 /// <param name="input1">Input number 1.</param>
 /// <param name="input2">Input number 2.</param>
 /// <param name="input3">Input number 3.</param>
 /// <param name="input4">Input number 4.</param>
 /// <param name="input5">Input number 5.</param>
 /// <param name="input6">Input number 6.</param>
 /// <param name="input7">Input number 7.</param>
 /// <param name="reactImmediately">Denotes if the reaction should fire immediately upon construction.</param>
 public ReactionPipelineStage(
     string name,
     Action <TInput1, TInput2, TInput3, TInput4, TInput5, TInput6, TInput7> reaction,
     IPipelineStage <TInput1> input1,
     IPipelineStage <TInput2> input2,
     IPipelineStage <TInput3> input3,
     IPipelineStage <TInput4> input4,
     IPipelineStage <TInput5> input5,
     IPipelineStage <TInput6> input6,
     IPipelineStage <TInput7> input7,
     bool reactImmediately)
 {
     Name     = name ?? throw new ArgumentNullException(nameof(name));
     Reaction = reaction ?? throw new ArgumentNullException(nameof(reaction));
     Input1   = input1 ?? throw new ArgumentNullException(nameof(input1));
     Input2   = input2 ?? throw new ArgumentNullException(nameof(input2));
     Input3   = input3 ?? throw new ArgumentNullException(nameof(input3));
     Input4   = input4 ?? throw new ArgumentNullException(nameof(input4));
     Input5   = input5 ?? throw new ArgumentNullException(nameof(input5));
     Input6   = input6 ?? throw new ArgumentNullException(nameof(input6));
     Input7   = input7 ?? throw new ArgumentNullException(nameof(input7));
     this.AddDependencies(input1, input2, input3, input4, input5, input6, input7);
     if (reactImmediately)
     {
         Reaction(Input1.GetValue(), Input2.GetValue(), Input3.GetValue(), Input4.GetValue(), Input5.GetValue(), Input6.GetValue(), Input7.GetValue());
     }
 }
コード例 #8
0
ファイル: MiniMaps.cs プロジェクト: utopiag/OpenVIII-monogame
 internal static void Input()
 {
     if (Input2.Button(FF8TextTagKey.Up) /* || shift.Y > 0*/)
     {
         if (fulscrMapCurY < 0.070f)
         {
             fulscrMapCurY = 0.870f;
         }
         fulscrMapCurY -= 0.005f * (float)Memory.ElapsedGameTime.TotalMilliseconds / 25.0f;
     }
     else if (Input2.Button(FF8TextTagKey.Down) /* || shift.Y < 0*/)
     {
         if (fulscrMapCurY > 0.870f)
         {
             fulscrMapCurY = 0.070f;
         }
         fulscrMapCurY += 0.005f * (float)Memory.ElapsedGameTime.TotalMilliseconds / 25.0f;
     }
     if (Input2.Button(FF8TextTagKey.Left) /*|| shift.X < 0*/)
     {
         if (fulscrMapCurX < 0.145f)
         {
             fulscrMapCurX = 0.745f;
         }
         fulscrMapCurX -= 0.003f * (float)Memory.ElapsedGameTime.TotalMilliseconds / 25.0f;
     }
     else if (Input2.Button(FF8TextTagKey.Right) /* || shift.X > 0*/)
     {
         if (fulscrMapCurX > 0.745)
         {
             fulscrMapCurX = 0.145f;
         }
         fulscrMapCurX += 0.003f * (float)Memory.ElapsedGameTime.TotalMilliseconds / 25.0f;
     }
 }
コード例 #9
0
ファイル: TwoInputGate.cs プロジェクト: Micevski/LCE
 public override void Move(Point delta)
 {
     base.Move(delta);
     Input1.Move(delta);
     Input2.Move(delta);
     Output.Move(delta);
 }
コード例 #10
0
        private void Update()
        {
            if (Input.GetAxis("Jump") > 0 && Grounded)
            {
                jump = true;
            }

            physics.AddRelativeTorque(0, Torque * Input2.GetAxis("Frame Yaw"), 0);
        }
コード例 #11
0
 override protected void SteeringStart()
 {
     //InputPlus.LearnController (1);
     InputPlus.Initialize(); //Start up InputPlus.
     InputPlus.SetDebugText(false);
     foreach (UnityLikeInput input in inputs)
     {
         input.con = GamePad_Num;
     }
     Input = new Input2(inputs);
 }
コード例 #12
0
 public override void Compute()
 {
     if (Control == null || Control.Value == 0)
     {
         Output.SetValue(Input1.GetValue());
     }
     else
     {
         Output.SetValue(Input2.GetValue());
     }
 }
コード例 #13
0
 public virtual void Update()
 {
     if (pl.IsMine)
     {
         var mb = Input2.GetKey(KeyCode.Mouse1) && _Game.started && (bullets > 0 || isDebug) && !room.disableRockets && !win.active;
         if (mb != shooting && shootTm > shootInterval)
         {
             pl.CallRPC(pl.SetShoot, mb);
         }
     }
 }
コード例 #14
0
ファイル: TwoInputGate.cs プロジェクト: Micevski/LCE
 public override WireHandle HookInHandle(Point p)
 {
     if (Input1.Selected(p))
     {
         return(Input1);
     }
     else if (Input2.Selected(p))
     {
         return(Input2);
     }
     return(null);
 }
コード例 #15
0
 public override void Inputs_Right()
 {
     if (Input2.Button(MouseButtons.MouseWheeldown) || Col == Cols - 1)
     {
         PAGE_NEXT();
         Refresh();
     }
     else
     {
         CURSOR_SELECT += Rows;
     }
     base.Inputs_Right();
 }
コード例 #16
0
 public override void Inputs_Left()
 {
     if (Input2.Button(MouseButtons.MouseWheelup) || Col == 0)
     {
         PAGE_PREV();
         Refresh();
     }
     else
     {
         CURSOR_SELECT -= Rows;
     }
     base.Inputs_Left();
 }
        public MainPage()
        {
            this.InitializeComponent();

            bool isInternetConnected = NetworkInterface.GetIsNetworkAvailable();

            if (isInternetConnected == true)
            {
                conn = new SQLiteConnection(new SQLitePlatformWinRT(), path); //資料庫連接
                conn.CreateTable <Data>();                                    //建立資料表

                GpioController gpio = GpioController.GetDefault();
                Input0 = gpio.OpenPin(4);
                Input0.SetDriveMode(GpioPinDriveMode.Input);
                Input1 = gpio.OpenPin(5);
                Input1.SetDriveMode(GpioPinDriveMode.Input);
                Input2 = gpio.OpenPin(17);
                Input2.SetDriveMode(GpioPinDriveMode.Input);
                Input3 = gpio.OpenPin(18);
                Input3.SetDriveMode(GpioPinDriveMode.Input);
                Input4 = gpio.OpenPin(22);
                Input4.SetDriveMode(GpioPinDriveMode.Input);
                Input5 = gpio.OpenPin(23);
                Input5.SetDriveMode(GpioPinDriveMode.Input);
                Input6 = gpio.OpenPin(24);
                Input6.SetDriveMode(GpioPinDriveMode.Input);
                Input7 = gpio.OpenPin(25);
                Input7.SetDriveMode(GpioPinDriveMode.Input);

                timer = new DispatcherTimer
                {
                    Interval = TimeSpan.FromMilliseconds(400)
                };
                timer.Tick += Timer_Tick;
                timer.Start();



                bgwWorker.DoWork                    += new DoWorkEventHandler(bgwWorker_DoWork);
                bgwWorker.RunWorkerCompleted        += new RunWorkerCompletedEventHandler(bgwWorker_RunWorkerCompleted);
                bgwWorker.ProgressChanged           += new ProgressChangedEventHandler(bgwWorker_ProgressChanged);
                bgwWorker.WorkerReportsProgress      = true;
                bgwWorker.WorkerSupportsCancellation = true;
            }

            else
            {
                wifisettingAsync();
            }
        }
コード例 #18
0
 private KeyCode FetchKey()
 {
     if (Input2.GetKeyDown(KeyCode.Escape))
     {
         return(KeyCode.None);
     }
     for (int i = 0; i < 429; i++)
     {
         if (Input2.GetKeyDown((KeyCode)i))
         {
             return((KeyCode)i);
         }
     }
     return(KeyCode.None);
 }
コード例 #19
0
        private void InitializeStageWatch()
        {
            deathCounter.Subscribe(count =>
            {
                for (int i = titleSettings.NextStageCount.Length - 1; i >= 0; --i)
                {
                    if (count < titleSettings.NextStageCount[i])
                    {
                        continue;
                    }
                    stageReactiveProperty.Value = i + 1;
                    return;
                }
            });
            stageReactiveProperty.Subscribe(stage =>
            {
                switch (stage)
                {
                case 0:
                    break;

                case 1:
                    EnemyPlayerCollisionSystem.Enabled = true;
                    break;

                case 2:
                    RainSystem.Enabled = true;
                    break;

                case 3:
                    Input1.Subscribe(ChangeWeapon1);
                    Input2.Subscribe(ChangeWeapon2);
                    武器欄.SetActive(true);
                    武器名 = 武器欄.transform.Find(nameof(武器名)).GetComponent <TMPro.TMP_Text>();
                    break;

                case 4:
                    // System.Buffer.BlockCopy(stage4EnemySpeed.Speeds, 0, enemySpeeds.Speeds, 0, enemySpeeds.Speeds.Length);
                    break;

                case 5:
                    // LastBossAppear();
                    break;

                default: break;
                }
            });
        }
コード例 #20
0
ファイル: GameChoose.cs プロジェクト: poooooooooke/OpenVIII
 public override bool Inputs()
 {
     if (Input2.DelayedButton(FF8TextTagKey.RotateLeft) || Input2.DelayedButton(FF8TextTagKey.RotateRight))
     {
         IGM_LGSG.Mode mode = (IGM_LGSG.Mode)Menu.IGM_LGSG.GetMode();
         init_debugger_Audio.PlaySound(0);
         mode ^= IGM_LGSG.Mode.Slot1;
         mode ^= IGM_LGSG.Mode.Slot2;
         Menu.IGM_LGSG.SetMode(mode);
         return(true);
     }
     else
     {
         return(base.Inputs());
     }
 }
コード例 #21
0
ファイル: StringTests.cs プロジェクト: Rype69/utilities
        public void Reverse()
        {
            // Arrange
            const string Input1          = "HELLO WORLD!";
            const string Input2          = "Lorem ipsum dolor sit amet";
            const string ExpectedResult1 = "!DLROW OLLEH";
            const string ExpectedResult2 = "tema tis rolod muspi meroL";

            // Act
            var result1 = Input1.Reverse();
            var result2 = Input2.Reverse();

            // Assert
            Assert.AreEqual(result1, ExpectedResult1);
            Assert.AreEqual(result2, ExpectedResult2);
        }
コード例 #22
0
 public override bool Inputs()
 {
     if (InputKeyboard.State.GetPressedKeys().Any(x => (int)x >= (int)Keys.D0 && (int)x <= (int)Keys.Z))
     {
         return(false);
     }
     else if (!string.IsNullOrWhiteSpace(filter) && Input2.DelayedButton(FF8TextTagKey.Cancel, ButtonTrigger.Press | ButtonTrigger.Force))
     {
         Inputs_CANCEL();
         return(true);
     }
     else
     {
         return(base.Inputs());
     }
 }
コード例 #23
0
 public override bool Inputs()
 {
     if (Input2.DelayedButton(FF8TextTagKey.RotateLeft) || Input2.DelayedButton(FF8TextTagKey.RotateRight))
     {
         var mode = (IGMLoadSaveGame.Mode)Menu.IGMLoadSaveGame.GetMode();
         AV.Sound.Play(0);
         mode ^= IGMLoadSaveGame.Mode.Slot1;
         mode ^= IGMLoadSaveGame.Mode.Slot2;
         Menu.IGMLoadSaveGame.SetMode(mode);
         return(true);
     }
     else
     {
         return(base.Inputs());
     }
 }
コード例 #24
0
 /// <summary>
 /// Creates a new <see cref="ReactionPipelineStage"/> with the specified name and reaction to the specified inputs.
 /// </summary>
 /// <param name="name">The name of the new reaction.</param>
 /// <param name="reaction">The reaction delegate.</param>
 /// <param name="input1">Input number 1.</param>
 /// <param name="input2">Input number 2.</param>
 /// <param name="reactImmediately">Denotes if the reaction should fire immediately upon construction.</param>
 public ReactionPipelineStage(
     string name,
     Action <TInput1, TInput2> reaction,
     IPipelineStage <TInput1> input1,
     IPipelineStage <TInput2> input2,
     bool reactImmediately)
 {
     Name     = name ?? throw new ArgumentNullException(nameof(name));
     Reaction = reaction ?? throw new ArgumentNullException(nameof(reaction));
     Input1   = input1 ?? throw new ArgumentNullException(nameof(input1));
     Input2   = input2 ?? throw new ArgumentNullException(nameof(input2));
     this.AddDependencies(input1, input2);
     if (reactImmediately)
     {
         Reaction(Input1.GetValue(), Input2.GetValue());
     }
 }
コード例 #25
0
 public void Read(BinaryReader br, int i)
 {
     Name = Memory.Strings.Read(Strings.FileID.KERNEL, id, i * 2);
     //0x0000	2 bytes Offset to name
     Description = Memory.Strings.Read(Strings.FileID.KERNEL, id, i * 2 + 1);
     //0x0002	2 bytes Offset to description
     br.BaseStream.Seek(4, SeekOrigin.Current);
     MagicID = (Magic_ID)br.ReadUInt16();
     //0x0004  2 bytes Magic ID
     Attack_Type = (AttackType)br.ReadByte();
     //0x0006  1 byte Attack type
     Attack_Power = br.ReadByte();
     //0x0007  1 byte Attack power
     Attack_Flags = (AttackFlags)br.ReadByte();
     //0x0008  1 byte Attack flags
     Unknown0 = br.ReadByte();
     //0x0009  1 byte Unknown
     Target = (Target)br.ReadByte();
     //0x000A  1 byte Target Info
     Unknown1 = br.ReadByte();
     //0x000B  1 bytes Unknown
     Hit_Count = br.ReadByte();
     //0x000C  1 byte Hit Count
     Element = (Element)br.ReadByte();
     //0x000D  1 byte Element Attack
     Element_Percent = br.ReadByte();
     //0x000E  1 byte Element Attack %
     Status_Attack = br.ReadByte();
     //0x000F  1 byte Status Attack Enabler
     Button_Combo = new List <IReadOnlyList <FF8TextTagKey> >(5);
     for (int b = 0; b < 5; b++)
     {
         Button_Combo.Add(Input2.Convert_Flags((Button_Flags)br.ReadUInt16()));
     }
     //0x0010  2 bytes Sequence Button 1
     //0x0012  2 bytes Sequence Button 2
     //0x0014  2 bytes Sequence Button 3
     //0x0016  2 bytes Sequence Button 4
     //0x0018  2 bytes Sequence Button 5
     Statuses0 = (Persistent_Statuses)br.ReadUInt16();
     //0x001A  2 bytes status_0; //statuses 0-7
     Statuses1 = (Battle_Only_Statuses)br.ReadUInt32();
     //0x001C  4 bytes status_1; //statuses 8-39
 }
コード例 #26
0
        public override bool TestGate()
        {
            int bits = Size - 1;

            for (int i = 0; i < 10; i++)
            {
                Random  rand = new Random();
                int     num1 = rand.Next((-(int)Math.Pow(2, bits - 1)), ((int)Math.Pow(2, bits - 1) - 1) + 1);
                int     num2 = rand.Next((-(int)Math.Pow(2, bits - 1)), ((int)Math.Pow(2, bits - 1) - 1) + 1);
                WireSet sum  = new WireSet(Size);
                sum.Set2sComplement(num1 + num2);
                Input1.Set2sComplement(num1);
                Input2.Set2sComplement(num2);
                if (Output.Get2sComplement() != sum.Get2sComplement())
                {
                    return(false);
                }
            }
            return(true);
        }
コード例 #27
0
        public override bool TestGate()
        {
            int    value1;
            int    value2;
            Random ran = new Random();

            for (int i = 0; i < 4; i++)
            {
                value1 = ran.Next(0, ((int)Math.Pow(2, Size) - 1) / 2);
                value2 = ran.Next(0, ((int)Math.Pow(2, Size) - 1) / 2);
                Input1.SetValue(value1);
                Input2.SetValue(value2);
                //Console.WriteLine(ToString());
                if (Output.GetValue() != value1 + value2)
                {
                    return(false);
                }
            }
            return(true);
        }
コード例 #28
0
    private void UpdateKeys()
    {
        if (UnityEngine.Input.GetKeyDown(KeyCode.Mouse3))
        {
            Application.CaptureScreenshot("screenshots/" + DateTime.Now.Ticks + ".png");
        }
        if (Application.isEditor)
        {
            if (Input.GetKeyDown(KeyCode.P))
            {
                Debug.Break();
            }
        }
        if (Input.GetKeyDown(KeyCode.Backslash))
        {
            reporter.gameObject.SetActive(!reporter.gameObject.activeSelf);
        }
        if (Input2.GetKeyDown(KeyCode.B, true))
        {
            _levelEditor.Toggle();
        }

        if (Input.GetKeyDown(KeyCode.Escape) || Input2.GetKeyDown(KeyCode.M))
        {
            if (!win.enabled && _GameGui)
            {
                win.ShowWindow(_GameGui.Menu);
            }
            else
            {
                win.Back();
            }
        }

        if (Input2.GetKeyDown(KeyCode.F12, true) || Input2.GetKeyDown(KeyCode.F11, true))
        {
            FullScreen();
        }
    }
コード例 #29
0
        private static IEnumerable <TestCaseData> GetSolveTestCases()
        {
            const string Input1 = @"
<x=-1, y=0, z=2>
<x=2, y=-10, z=-7>
<x=4, y=-8, z=8>
<x=3, y=5, z=-1>";

            yield return(new TestCaseData(Input1.Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries), 10, 179)
            {
                TestName = "case 1"
            });

            const string Input2 = @"
<x=-8, y=-10, z=0>
<x=5, y=5, z=10>
<x=2, y=-7, z=3>
<x=9, y=-8, z=-3>";

            yield return(new TestCaseData(Input2.Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries), 100, 1940)
            {
                TestName = "case 2"
            });
        }
コード例 #30
0
 public string get_something_else(Input2 input)
 {
     throw new NotImplementedException();
 }
コード例 #31
0
 public Resource3 get_third_resource(Input2 input)
 {
     return new Resource3();
 }
 public void M2(Input2 input){}
コード例 #33
0
 public Output2 NonJsonPartial(Input2 input)
 {
     return null;
 }
コード例 #34
0
 public Output2 Assymmetric(Input2 input)
 {
     return null;
 }
 public Output2 M2(Input2 input)
 {
     return null;
 }
コード例 #36
0
 public Resource3 get_third_resource(Input2 input)
 {
     return(new Resource3());
 }
コード例 #37
0
 public void Call(Input2 input2)
 {
 }