コード例 #1
0
        private void RandColors_Click(object sender, RoutedEventArgs e)
        {
            ColorHSV[] colors = FlagGenerator.GetRandomColors();

            txtBack1.Text    = colors[0].ToRGB().ToHex(false, false);
            txtBack2.Text    = colors[1].ToRGB().ToHex(false, false);
            txtBack3.Text    = colors[2].ToRGB().ToHex(false, false);
            txtOverlay1.Text = colors[3].ToRGB().ToHex(false, false);
            txtOverlay2.Text = colors[4].ToRGB().ToHex(false, false);
        }
コード例 #2
0
        public Flag genFlag(long flagId)
        {
            lock (flagLock)
            {
                if (flagGenerator == null)
                {
                    flagGenerator = FlagGenerator.FromFile(@"flags/flags.txt");
                }
            }

            return(flagGenerator.Generate((int)flagId));
        }
コード例 #3
0
        private void RandOptions_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                var randOptions = FlagGenerator.GetRandomEnums();

                SelectBackType(randOptions.Item1);
                SelectOverlay(randOptions.Item2, 1);
                SelectOverlay(randOptions.Item3, 2);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(), this.Title, MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
コード例 #4
0
        private void GenerateFlags()
        {
            foreach (Texture2D flag in Flags)
            {
                flag.Dispose();
            }

            Flags.Clear();
            FlagGenerator flagGenerator = new FlagGenerator();
            Random        rng           = new Random();

            for (int i = 0; i < 100; i++)
            {
                Flags.Add(flagGenerator.GenerateRandom(Game.GraphicsDevice, 120, 80, rng));
            }
        }
コード例 #5
0
    public void Init(Map map)
    {
        EventHandler = new GameEventHandler(this);
        FlagGenerator = GameObject.Find("FlagGenerator").GetComponent<FlagGenerator>();
        FlagGenerator.GenerateFlag();
        Map = map;
        Map.InitializeMap(showRegionBorders: true, showShorelineBorders: true, showContinentBorders: false, showWaterConnections: false, MapColorMode.Basic, MapTextureMode.BiomeTextures);
        GameUI = GameObject.Find("GameUI").GetComponent<GameUI>();
        MarkovChainWordGenerator.TargetNumWords = Map.Regions.Count * 2;
        GameObject.Find("LoadingScreen").SetActive(false);

        // Camera
        CameraHandler = Camera.main.GetComponent<CameraHandler>();
        CameraHandler.SetMap(map);
        CameraHandler.JumpToFocusMap(map);

        GameUI.AddLog("Welcome to this new empty world.");
    }