예제 #1
0
        public static void Main(string[] args)
        {
            redis     = ConnectionMultiplexer.Connect(redisCs);
            itemStats = new ItemStatistics(redis);
            var quit = false;

            while (!quit)
            {
                Console.WriteLine("Use redis (R) or postgressql (P) and (c) to quit!");
                var dbType = Console.ReadKey();
                if (dbType.KeyChar == 'R')
                {
                    RunRedisSample();
                }
                else if (dbType.KeyChar == 'P')
                {
                    RunPostgresSql();
                }
                if (dbType.KeyChar == 'c')
                {
                    quit = true;
                }
            }
            redis.Dispose();
        }
예제 #2
0
        private static int SortByMax(ItemStatistics a, ItemStatistics b)
        {
            if (a.MaxPropertyValue < b.MaxPropertyValue)
            {
                return(-1);
            }
            else if (a.MaxPropertyValue > b.MinPropertyValue)
            {
                return(1);
            }

            return(0);
        }
예제 #3
0
        private static int SortByCount(ItemStatistics a, ItemStatistics b)
        {
            if (a.PropertyCount < b.PropertyCount)
            {
                return(-1);
            }
            else if (a.PropertyCount > b.PropertyCount)
            {
                return(1);
            }

            return(0);
        }
예제 #4
0
    void DisplayUpgrade2(ItemStatistics stats)
    {
        string text = "";

        m_upgrade.maxFuel      = Mathf.Round(Random.Range(0, stats.maxFuel) - m_current.maxFuel);
        m_upgrade.maxVelocity  = Mathf.RoundToInt(Random.Range(0, stats.maxVelocity) - m_current.maxVelocity);
        m_upgrade.maxPingSpeed = Mathf.RoundToInt(Random.Range(0, stats.maxPingSpeed) - m_current.maxPingSpeed);

        if (m_upgrade.maxFuel != 0)
        {
            text += (m_upgrade.maxFuel < 0 ? "" : "+") + m_upgrade.maxFuel + " fuel\n";
        }
        if (m_upgrade.maxVelocity != 0)
        {
            text += (m_upgrade.maxVelocity < 0 ? "" : "+") + m_upgrade.maxVelocity + " velocity\n";
        }
        if (m_upgrade.maxPingSpeed != 0)
        {
            text += (m_upgrade.maxPingSpeed < 0 ? "" : "+") + m_upgrade.maxPingSpeed + " ping\n";
        }

        m_choice.Item2Text = text;
    }
예제 #5
0
 public FakeItem WithStatistics(ItemStatistics statistics)
 {
     Item.Statistics.Returns(statistics);
     return(this);
 }
예제 #6
0
        private static int SortByMin( ItemStatistics a, ItemStatistics b )
        {
            if ( a.MinPropertyValue < b.MinPropertyValue )
                return -1;
            else if ( a.MinPropertyValue > b.MinPropertyValue )
                return 1;

            return 0;
        }
예제 #7
0
        private static int SortByCount( ItemStatistics a, ItemStatistics b )
        {
            if ( a.PropertyCount < b.PropertyCount )
                return -1;
            else if ( a.PropertyCount > b.PropertyCount )
                return 1;

            return 0;
        }
예제 #8
0
 public StatisticsAdapter(ItemStatistics statistics)
 {
     _statistics = statistics;
 }