Exemplo n.º 1
0
        void GameTypeSelectionChanged(int selectedIndex)
        {
            /* the display of the number of players
             * changes depending upon the template */
            selectedGot = templates[selectedIndex];

            UpdatePlayersDisplay();
        }
 public BidirectionalPassthroughSignalTally(ISignalSource parentSignalSource)
 {
     ParentSignalSource       = parentSignalSource;
     tallyState               = new PassthroughSignalTallyState(ParentSignalSource);
     tallyReceiver            = new PassthroughSignalTallyReceiver();
     tallyState.StateChanged += tallyStateChanged;
     tallyReceiver.Got       += (r, rc) => Got?.Invoke(r, rc);
     tallyReceiver.Revoked   += (r, rc) => Revoked?.Invoke(r, rc);
 }
Exemplo n.º 3
0
 public GameScreen(Mpq mpq,
                   Mpq scenario_mpq,
                   Chk scenario,
                   Got template) : base(mpq)
 {
     effectpal_path = "game\\tblink.pcx";
     arrowgrp_path  = "cursor\\arrow.grp";
     fontpal_path   = "game\\tfontgam.pcx";
     //this.scenario_mpq = scenario_mpq;
     this.scenario = scenario;
     this.template = template;
     ScrollCursors = new CursorAnimator[8];
 }
Exemplo n.º 4
0
        void PopulateGameTypes()
        {
            /* load the templates we're interested in displaying */
            StreamReader sr           = new StreamReader((Stream)mpq.GetResource("templates\\templates.lst"));
            List <Got>   templateList = new List <Got>();
            string       l;

            while ((l = sr.ReadLine()) != null)
            {
                string t = l.Replace("\"", "");

                Got got = (Got)mpq.GetResource("templates\\" + t);
                if (got == null)
                {
                    continue;
                }

                if (got.ComputerPlayersAllowed && got.NumberOfTeams == 0)
                {
                    Console.WriteLine("adding template {0}:{1}", got.UIGameTypeName, got.UISubtypeLabel);
                    templateList.Add(got);
                }
            }

            templates = new Got[templateList.Count];
            templateList.CopyTo(templates, 0);

            Array.Sort(templates, delegate(Got g1, Got g2) { return(g1.ListPosition - g2.ListPosition); });

            /* fill in the game type menu.
             * we only show the templates that allow computer players, have 0 teams */
            foreach (Got got in templates)
            {
                gametype_combo.AddItem(got.UIGameTypeName);
            }
            gametype_combo.SelectedIndex = 0;

            GameTypeSelectionChanged(gametype_combo.SelectedIndex);
        }
Exemplo n.º 5
0
        public string ToString(Dictionary <int, string> tokenMap, bool putPositionAtFront = true)
        {
            string value = "";

            if (putPositionAtFront)
            {
                value += Location.ToString() + " ";
            }
            value += "Error: Expected ";
            value += Expected.Match(EOF: () => "EOF",
                                    Token: t => tokenMap[t],
                                    Option: options =>
            {
                string description = "";
                for (int i = 0; i < options.Count(); i++)
                {
                    if (i != options.Count() - 1)
                    {
                        description += options[i] + ", ";
                    }
                    else
                    {
                        description += "or " + options[i];
                    }
                }
                return(description);
            });
            value += Got.Match(EOF: () => ", but got EOF",
                               Token: t => ", but got " + tokenMap[t.Type],
                               None: () => ""
                               );
            if (!putPositionAtFront)
            {
                value += " at " + Location.ToString();
            }
            return(value);
        }
Exemplo n.º 6
0
        void GameTypeSelectionChanged(int selectedIndex)
        {
            /* the display of the number of players
             * changes depending upon the template */
            selectedGot = templates[selectedIndex];

            UpdatePlayersDisplay ();
        }
Exemplo n.º 7
0
		public GameScreen (Mpq mpq,
				   Mpq scenario_mpq,
				   Chk scenario,
				   Got template) : base (mpq)
		{
			effectpal_path = "game\\tblink.pcx";
			arrowgrp_path = "cursor\\arrow.grp";
			fontpal_path = "game\\tfontgam.pcx";
			//this.scenario_mpq = scenario_mpq;
			this.scenario = scenario;
			this.template = template;
			ScrollCursors = new CursorAnimator[8];
		}