Пример #1
0
        private void initTiles()
        {
            TILE_COUNT = XMAX * YMAX;

            tiles = new byte[TILE_COUNT];
            num   = new int[TILE_COUNT];
            rcel  = new int[TILE_COUNT];

            join    = new JoinData[TILE_COUNT];
            regions = new Region[MAX_REGION_COUNT + 1];

            colors = new Color[MAX_REGION_COUNT + 2];

            for (int i = 0; i < MAX_REGION_COUNT; ++i)
            {
                colors[i] = Color.FromArgb(rand.Next(255), rand.Next(255), rand.Next(255));
            }
            colors[MAX_REGION_COUNT]     = Color.FromArgb(255, 255, 255);
            colors[MAX_REGION_COUNT + 1] = Color.FromArgb(0, 0, 0);

            for (int i = 0; i < TILE_COUNT; ++i)
            {
                num[i] = i;
            }
            for (int i = 0; i < TILE_COUNT; ++i)
            {
                join[i] = new JoinData();
                for (int d = 0; d < 6; ++d)
                {
                    join[i].dir[d] = NextCell(i, d);
                }
            }
        }
Пример #2
0
        virtual public void Init(BigDB db)
        {
            Object tmp;

            if (JoinData.ContainsKey("Guest") && Convert.ToBoolean(JoinData["Guest"]))
            {
                username = JoinData["Name"];
                isGuest  = true;
            }

            if (!isGuest)
            {
                // if username exists, we have registered user so we take that as his name, if it is not set
                // we have guest so we take his name from ConnectUserId
                if (PlayerObject.TryGetValue("Username", out tmp))
                {
                    username = (String)tmp;
                }
                if (username == null && JoinData.ContainsKey("Name"))
                {
                    username = JoinData["Name"];
                }
                InitializeDB();
                PayVault.Refresh(null);
                bigDB         = db;
                achievManager = new Achievements.AchievementManager(bigDB, this);
            }
            else
            {
                savingFinished();

                rankingOriginal    = 0;
                rankingGS          = -1500 / 173.7178f;
                rankingDeviation   = 350;
                rankingDeviationGS = rankingDeviation / 173.7178f;
            }

            //messageTimer = AddTimer(messageTimerTick, 3000);
        }