Esempio n. 1
0
        internal void RebuildGameHole(GameMapFlag Map)
        {
            byte WP;
            byte WD;
            byte P;

            for (int I = 0; I < 17; I++)
            {
                WP = (byte)rnd.Next(0, 8);
                WD = (byte)rnd.Next(255);
                P  = (byte)(rnd.Next(1, 3));

                this[I].Hole          = (byte)(I + 1);
                this[I].Weather       = (byte)rnd.Next(0, 3);
                this[I].WindPower     = WP;
                this[I].WindDirection = WD;
                this[I].Map           = Map;
                this[I].Pos           = P;
            }
        }
Esempio n. 2
0
        void InitGameHole(GameModeFlag gameMode, GameTypeFlag gameType, bool IsRepeted = false, GameMapFlag Map = GameMapFlag.Blue_Lagoon)
        {
            byte WP;
            byte WD;
            byte P;
            int  x;

            int[] H;
            int[] M;

            if (Map == GameMapFlag.Unknown)
            {
                Map = (GameMapFlag)GameTools.GetMap();
            }

            if (gameType == GameTypeFlag.HOLE_REPEAT && IsRepeted)
            {
                for (x = 0; x <= 17; x++)
                {
                    WP = (byte)rnd.Next(0, 8);
                    WD = (byte)rnd.Next(255);
                    P  = (byte)rnd.Next(1, 3);

                    this[x].Hole          = (byte)(x + 1);
                    this[x].Weather       = (byte)rnd.Next(0, 3);
                    this[x].WindPower     = WP;
                    this[x].WindDirection = WD;
                    this[x].Map           = Map;
                    this[x].Pos           = P;
                }
                // leave
                return;
            }
            switch (gameMode)
            {
            case GameModeFlag.GAME_MODE_FRONT:
                for (x = 0; x <= 17; x++)
                {
                    this[x].Hole          = (byte)(x + 1);
                    this[x].Weather       = (byte)rnd.Next(0, 3);
                    this[x].WindPower     = (byte)rnd.Next(0, 8);
                    this[x].WindDirection = (byte)rnd.Next(255);
                    this[x].Map           = Map;
                    this[x].Pos           = (byte)rnd.Next(1, 3);
                }
                break;

            case GameModeFlag.GAME_MODE_BACK:
                for (x = 0; x <= 17; x++)
                {
                    this[x].Hole          = (byte)(18 - x);
                    this[x].Weather       = (byte)rnd.Next(0, 3);
                    this[x].WindPower     = (byte)rnd.Next(0, 8);
                    this[x].WindDirection = (byte)rnd.Next(255);
                    this[x].Pos           = (byte)rnd.Next(1, 3);
                }
                break;

            case GameModeFlag.GAME_MODE_SHUFFLE:
            case GameModeFlag.GAME_MODE_RANDOM:
                H = GameTools.RandomHole();
                for (x = 0; x <= 17; x++)
                {
                    this[x].Hole          = (byte)H[x];
                    this[x].Weather       = (byte)rnd.Next(0, 3);
                    this[x].WindPower     = (byte)rnd.Next(0, 8);
                    this[x].WindDirection = (byte)rnd.Next(255);
                    this[x].Map           = Map;
                    this[x].Pos           = (byte)rnd.Next(1, 3);
                }
                break;

            case GameModeFlag.GAME_MODE_SSC:
                H = GameTools.RandomHole();
                M = GameTools.RandomMap();
                for (x = 0; x <= 17; x++)
                {
                    this[x].Hole          = (byte)H[x];
                    this[x].Weather       = (byte)rnd.Next(0, 3);
                    this[x].WindPower     = (byte)rnd.Next(0, 8);
                    this[x].WindDirection = (byte)rnd.Next(255);
                    this[x].Map           = (GameMapFlag)M[x];
                    this[x].Pos           = (byte)rnd.Next(1, 3);
                }
                this.Last().Hole = (byte)(rnd.Next(0, 2) + 1);
                this.Last().Map  = GameMapFlag.Special_Flag;
                break;

            default:
                for (x = 0; x <= 17; x++)
                {
                    this[x].Hole          = (byte)(x + 1);
                    this[x].Weather       = (byte)rnd.Next(0, 3);
                    this[x].WindPower     = (byte)rnd.Next(0, 8);
                    this[x].WindDirection = (byte)rnd.Next(255);
                    this[x].Map           = Map;
                    this[x].Pos           = (byte)rnd.Next(1, 3);
                }
                break;
            }
        }
Esempio n. 3
0
 public void Init(GameModeFlag Mode, GameTypeFlag Type, bool Repeted, GameMapFlag Map, byte holeCount)
 {
     m_holeCount = holeCount;
     InitGameHole(Mode, Type, Repeted, Map);
 }