コード例 #1
0
ファイル: BlockBehaviour.cs プロジェクト: kaimelis/GameJamPro
 public void Activate(ForkType type)
 {
     if (type == _triggeredByForkTpe)
     {
         EnableRenderer();
     }
 }
コード例 #2
0
        public int CompareTo(HFSExtentKey?other)
        {
            if (other is null)
            {
                return(1);
            }

            int result = FileId.CompareTo(other.FileId);

            if (result == 0)
            {
                result = ForkType.CompareTo(other.ForkType);
            }
            if (result == 0)
            {
                result = StartBlock.CompareTo(other.StartBlock);
            }
            return(result);
        }
コード例 #3
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Mouse0))
        {
            if (EnoughAmmo())
            {
                _forkThrow.Throw(_currentPrefab);
                ManageInventory();
            }
        }

        if (Input.GetKeyDown(KeyCode.E))
        {
            _currentFork   = (int)_currentFork < (int)ForkType.Length - 1? ++_currentFork : 0;
            _currentPrefab = GetPrefab();
        }
        if (Input.GetKeyDown(KeyCode.Q))
        {
            _currentFork   = (int)_currentFork > 0? --_currentFork : ForkType.Length - 1;
            _currentPrefab = GetPrefab();
        }
    }
コード例 #4
0
 public override int GetHashCode()
 => ForkType.GetHashCode() ^ FileId.GetHashCode() ^ StartBlock.GetHashCode();
コード例 #5
0
        /// <summary>
        /// Создает вилку
        /// </summary>
        /// <param name="one">ставка 1</param>
        /// <param name="two">ставка 2</param>
        /// <param name="bt1">нужный коэфицент</param>
        /// <param name="bt2">нужный коэфицент</param>
        /// <param name="to1">Навзание коэфицента</param>
        /// <param name="to2">Навзание коэфицента</param>
        /// <param name="data1">Данные для открытия первой ставки</param>
        /// <param name="data2">Данные для открытия второй ставки</param>
        /// <param name="forktype">Тип вилки</param>
        /// <returns></returns>
        private static Fork CreateFork(Bet one, Bet two, float bt1, float bt2, string to1, string to2, object data1, object data2, ForkType forktype = ForkType.Main)
        {
            Fork fr = new Fork();

            fr.ForkType  = forktype;
            fr.SportName = one.Groupe;
            fr.Teams     = one.Name;

            fr.Cof1 = bt1;
            fr.Cof2 = bt2;

            fr.SiteOne = one.Site;
            fr.SiteTwo = two.Site;

            fr.To1 = to1;
            fr.To2 = to2;


            fr.Url1 = one.URL;
            fr.Url2 = two.URL;

            //if (one.Time == two.Time)
            //    fr.Time = one.Time;
            //else
            //    fr.Time = one.Time + " " + two.Time;

            if (one.Time != null && one.Time != "-1")
            {
                if (one.Time.Contains(":"))
                {
                    fr.Time = one.Time.Split(':').First() + "'";
                }
                else
                {
                    fr.Time = one.Time;
                }
            }
            else
            {
                if (two.Time != null && two.Time != "-1")
                {
                    if (two.Time.Contains(":"))
                    {
                        fr.Time = two.Time.Split(':').First() + "'";
                    }
                    else
                    {
                        fr.Time = two.Time;
                    }
                }
            }

            if (one.SportType == two.SportType)
            {
                fr.SportType = one.SportType;
            }
            else
            {
                fr.SportType = SportType.Other;
            }

            fr.Data1 = data1;
            fr.Data2 = data2;

            fr.TypeOne = one.Bookmaker;
            fr.TypeTwo = two.Bookmaker;

            fr.Profit = (1 / ((1 / bt1) + (1 / bt2)) - 1) * 100;

            return(fr);
        }
コード例 #6
0
ファイル: BlockBehaviour.cs プロジェクト: kaimelis/GameJamPro
 public void DeActivate(ForkType type)
 {
 }