コード例 #1
0
ファイル: Discovery.cs プロジェクト: ybug/CivOne
        public Discovery(IAdvance advance)
        {
            _advance = advance;
            _modern  = Human.HasAdvance <Electricity>() && advance.Not <Electricity>();
            string scientistName = Human.HasAdvance <Invention>() && (advance.Not <Invention>()) ? "scientists" : "wise men";

            Picture background = Resources[$"DISCOVR{(_modern ? 2 : 1)}"];

            Palette = background.Palette;
            this.Clear(32)
            .AddLayer(background);

            string[] text = new string[]
            {
                $"{Human.TribeName} {scientistName}",
                "discover the secret",
                $"of {advance.Name}!"
            };


            for (int i = 0; i < text.Length; i++)
            {
                if (_modern)
                {
                    this.DrawText(text[i], 0, 3, 101, 30 + (8 * i));
                }
                else
                {
                    this.DrawText(text[i], 5, 32, 101, 7 + (15 * i))
                    .DrawText(text[i], 5, 15, 101, 6 + (15 * i));
                }
            }

            this.AddLayer(advance.Icon, 119, _modern ? 53 : 61);

            PlaySound(Human.Civilization.Tune);
        }
コード例 #2
0
        public Discovery(IAdvance advance)
        {
            _advance = advance;
            _modern  = Human.HasAdvance <Electricity>() && advance.Not <Electricity>();
            string scientistName = Human.HasAdvance <Invention>() && (advance.Not <Invention>()) ? "scientists" : "wise men";

            Picture background = Resources.Instance.LoadPIC(_modern ? "DISCOVR2" : "DISCOVR1");

            _canvas = new Picture(320, 200, background.Palette);
            _canvas.FillRectangle(32, 0, 0, 320, 200);

            AddLayer(background);

            string[] text = new string[]
            {
                $"{Human.TribeName} {scientistName}",
                "discover the secret",
                $"of {advance.Name}!"
            };


            for (int i = 0; i < text.Length; i++)
            {
                if (_modern)
                {
                    _canvas.DrawText(text[i], 0, 3, 101, 30 + (8 * i));
                }
                else
                {
                    _canvas.DrawText(text[i], 5, 32, 101, 7 + (15 * i));
                    _canvas.DrawText(text[i], 5, 15, 101, 6 + (15 * i));
                }
            }

            AddLayer(advance.Icon, 119, _modern ? 53 : 61);
        }