コード例 #1
0
        public static void BuildSelectedTurrets(FormFrame frame, int FactionNumber)
        {
            frame.ClearForms();
            frame.Commit("AllTurrets", true);
            for (int x = 0; x < Faction.MaxCards; x++)
            {
                TurretCard c = (TurretCard)FactionManager.Factions[FactionNumber].Cards[x];
                TurretForm t = new TurretForm();
                GameManager.GetLevel().AddObject(t);
                frame.Add(t);

                string s = c.GetUnitImagePath().Equals("") ?
                           "Textures/ShipGame/TurretPictures/" + c.GetImagePath() :
                           "Textures/ShipGame/UnitPictures/" + c.GetUnitImagePath();

                t.SetValues(AssetManager.Load <Texture2D>(s), AssetManager.Load <SpriteFont>("Fonts/ShipGame/EventFont"), c.Name,
                            c.GetColor(), new Vector2(150 * x, 0), new Vector2(125), c);
            }

            frame.Commit("AllTurrets", false);
            frame.DeActivate();
        }
コード例 #2
0
        public static void BuildAllTurrets(FormFrame frame)
        {
            int x;

            for (int y = 0; y < 5; y++)
            {
                x = 0;
                foreach (TurretCard c in FactionCard.SortedTurretDeck[y])
                {
                    TurretForm t = new TurretForm();
                    GameManager.GetLevel().AddObject(t);
                    frame.Add(t);

                    string s = c.GetUnitImagePath().Equals("") ?
                               "Textures/ShipGame/TurretPictures/" + c.GetImagePath() :
                               "Textures/ShipGame/UnitPictures/" + c.GetUnitImagePath();

                    t.SetValues(AssetManager.Load <Texture2D>(s), AssetManager.Load <SpriteFont>("Fonts/ShipGame/EventFont"), c.Name,
                                c.GetColor(), new Vector2(150 * x, 150 * y), new Vector2(125), c);
                    x++;
                }
            }
            frame.Commit("AllTurrets", true);
        }