Example #1
0
 public Deck(Stack <Card> cards, PokemonCardGame game)
 {
     _game          = game;
     deck           = cards;
     _highestZIndex = GameConstants.RENDER_FLOOR;
     Position       = new Vector2(10, 10);
 }
Example #2
0
 public ServerLobbyScreen(PokemonCardGame game)
 {
     currentGame     = game;
     content         = new ContentManager(currentGame.Services, "Content");
     BackgroundAsset = "LobbyMenu";
     ScreenTitle     = TITLE_LOBBY;
     ScreenLevel     = 1;
 }
Example #3
0
        public GameplayScreen(PokemonCardGame game)
        {
            currentGame = game;
            content     = new ContentManager(currentGame.Services, "Content");

            ScreenTitle = TITLE_GAMEPLAY;
            ScreenLevel = 2;
        }
Example #4
0
        public DeckBuilder(string path, PokemonCardGame game)
        {
            _game   = game;
            content = new ContentManager(_game.Services, "Content");

            XMLCards = new List <XMLCard>();
            DeckPath = path;
        }
Example #5
0
 /// <summary>
 /// Constructs a new textured button.
 /// </summary>
 /// <param name="asset">Path to the texture asset for this button.</param>
 /// <param name="position">Vector to position the button at.</param>
 /// <param name="visible">Whether or not you want the button to initially be visiible.</param>
 /// <param name="game">Game instance.</param>
 public Button(string asset, Vector2 position, bool visible, PokemonCardGame game)
     : this(game)
 {
     TextureAsset = asset;
     Position     = position;
     Active       = false;
     Visible      = visible;
     ZIndex       = GameConstants.RENDER_INTERFACE_LEVEL;
 }
Example #6
0
        public ClientIntermediary(PokemonCardGame game)
        {
            currentGame = game;

            RecievedActions = new Queue <NetWrapper>();
            SendingActions  = new Queue <NetWrapper>();

            ID = Guid.NewGuid();
        }
Example #7
0
        public ScreenManager(PokemonCardGame game)
        {
            currentGame  = game;
            justSwitched = false;

            Screens = new Stack <GameScreen>();

            Screens.Push(new MainMenuScreen(currentGame));
        }
Example #8
0
 /// <summary>
 /// Construcs a new button with optional parameters.
 /// </summary>
 /// <param name="game">Game instance.</param>
 /// <param name="position">Position to place the button inside. If not using default
 /// textures make sure to specify a width and height of the rectangle.</param>
 /// <param name="label">Text to overlay on the button.</param>
 /// <param name="labelColor">Color of overlaid text.</param>
 /// <param name="colorOverlay">Color to tint the button with. If no texture is used
 /// this is the background color for the button.</param>
 /// <param name="hoverColor">Color to overlay the button with on mouse hover.</param>
 /// <param name="asset">Path to the texture asset for this button.</param>
 /// <param name="visible">Whether or not you want the button to initially be visiible.</param>
 public Button(PokemonCardGame game, Rectangle?position = null, string label = null, Color?labelColor = null, Color?colorOverlay = null, Color?hoverColor = null, string asset = null, bool visible = true)
     : this(asset, new Vector2(0, 0), visible, game)
 {
     _PositionBox    = position ?? new Rectangle(0, 0, 295, 135); //HACK default texture width/height...
     Position        = new Vector2(_PositionBox.X, _PositionBox.Y);
     BackgroundColor = colorOverlay ?? Color.White;
     HoverColor      = hoverColor ?? Color.LightSlateGray;
     Label           = label;
     FontColor       = labelColor ?? Color.Black;
 }
Example #9
0
        public TextBoxMulti(string initialText, Vector2 position, PokemonCardGame game)
            : base(initialText, position, game)
        {
            Lines    = new string[7];
            Lines[0] = InitialText;

            TextureAsset = "TextBox";
            FontName     = "UIFont";
            FontColor    = Color.White;
            Padding      = 3;
        }
Example #10
0
        public TextBoxSingle(string initialText, Vector2 position, PokemonCardGame game) : base(game)
        {
            Text = InitialText = initialText;

            TextureAsset = "TextBoxSingle";
            ContentsFont = game.Content.Load <SpriteFont>("UIFont");
            Position     = position;
            Visible      = true;
            Active       = false;
            ZIndex       = GameConstants.RENDER_INTERFACE_LEVEL;
        }
Example #11
0
 public MainMenuScreen(PokemonCardGame game)
 {
     currentGame     = game;
     content         = new ContentManager(currentGame.Services, "Content");
     BackgroundAsset = "MainMenu";
     ScreenTitle     = TITLE_MAINMENU;
     ScreenLevel     = 0;
     //System.Diagnostics.Debug.WriteLine(currentGame.Window.ClientBounds.Width + ", " + currentGame.Window.ClientBounds.Height);
     LayoutManager = new FluidLayoutContainer(new Rectangle(0, 0, GameConstants.SCREEN_WIDTH, GameConstants.SCREEN_HEIGHT),
                                              Edge.Left, 25);
 }
Example #12
0
        public NPlayer(byte playerNumber, PokemonCardGame game)
        {
            _game = game;

            PlayerNumber = playerNumber;

            PlayerDeck    = new Deck(_game);
            PlayerDiscard = new Deck(_game);
            PlayerPrize   = new Deck(_game);
            PlayerHand    = new Hand(_game);
        }
Example #13
0
        public ServerOptionsScreen(PokemonCardGame game)
        {
            currentGame     = game;
            content         = new ContentManager(currentGame.Services, "Content");
            BackgroundAsset = "MainMenu";
            ScreenTitle     = TITLE_SERVEROPTIONS;
            ScreenLevel     = 0;

            LayoutManager = new FluidLayoutContainer(new Rectangle(0, 0, GameConstants.SCREEN_WIDTH, GameConstants.SCREEN_HEIGHT),
                                                     Edge.Top, 25);
            TestButtons = new Button[6];
        }
Example #14
0
        /// <summary>
        /// Constructs a new server lobby screen object assuming a connection to
        /// the server has been made.
        /// </summary>
        /// <param name="game">The current game instance.</param>
        /// <param name="serverAddress">IP address of the connected server.</param>
        public ServerLobbyScreen(PokemonCardGame game, IPAddress serverAddress)
        {
            currentGame = game;
            ServerIP    = serverAddress;
            content     = new ContentManager(currentGame.Services, "Content");
            ScreenTitle = TITLE_LOBBY;
            ScreenLevel = 1; // NOTE I don't think screenlevel is being used anywhere ... look into that

            SearchBar.Disabled    = true;
            SearchButton.Disabled = true;

            if (SearchForServer())
            {
                JoinButton.Disabled = false;
            }
        }
Example #15
0
        public NowPlayingScreen(PokemonCardGame game)
        {
            currentGame  = game;
            content      = new ContentManager(currentGame.Services, "Content");
            intermediary = new ClientIntermediary(game);
            // HACK endpoint should be loaded in ini/xml
            serverEndpoint = new IPEndPoint(new IPAddress(GameConstants.SERVER_IP), GameConstants.SERVER_PORT);

            BackgroundAsset = "GameMat";
            ScreenTitle     = TITLE_GAMEPLAY;
            ScreenLevel     = 2;

            LayoutManager = new FluidLayoutContainer(new Rectangle(0, 0, GameConstants.SCREEN_WIDTH, GameConstants.SCREEN_HEIGHT),
                                                     Edge.Top, 50);
            TestButton = new Button(currentGame, position: new Rectangle(0, 0, 150, 75), colorOverlay: Color.Black, label: "Action", labelColor: Color.White);
        }
Example #16
0
        public Card(string assetName, string cardName, Vector2 position, int health, float zIndex, CardType type, int pokemonStage, Action[] attacks,
                    Action ability, PokemonCardGame game)
        {
            /*
             * This constructor assumes the initial card placement is always in a deck.
             * If this turns out not to be the case, remember to change it...
             */

            _assetName = assetName;
            if (cardName == null) // make up a name from the assetName
            {
                StringBuilder s = new StringBuilder();
                foreach (char c in assetName)
                {
                    if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z'))
                    {
                        s.Append(c);
                    }
                }
                CardName = s.ToString();
            }
            else
            {
                CardName = cardName;
            }

            _position     = position;
            _prevPosition = _position; // initial state makes them equal so _prevPosition is never null
            Active        = false;
            Health        = health;

            TypeOfCard       = type;
            PokemonStage     = pokemonStage;
            AttachedNext     = null; // not going to be any cards attached at object construction
            AttachedPrev     = null;
            Attacks          = attacks;
            Ability          = ability;
            StatusConditions = new List <CardStatus>(); // all cards will init clean

            Dragging  = false;
            Size      = CardSize.Deck;
            Placement = CardPlacement.Deck;
            ZIndex    = zIndex;

            _game = game;
        }
Example #17
0
 protected Button(PokemonCardGame game)
 {
     currentGame     = game;
     BackgroundColor = Color.White; // Apply no tint so the button is fully visible by default
 }
Example #18
0
 public GameOptionsScreen(PokemonCardGame game)
 {
 }
Example #19
0
 public KeyboardHandler(PokemonCardGame game)
 {
     lastKeysPressed = new Keys[0];
     Typing          = false;
     currentGame     = game;
 }
Example #20
0
 public DeckEditorScreen(PokemonCardGame game)
 {
 }
Example #21
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="initialText"></param>
 /// <param name="position"></param>
 /// <param name="game"></param>
 public TextBoxFloating(string[] initialText, Vector2 position, string font, Color color, PokemonCardGame game)
     : base(game)
 {
     Text = new List <string>();
     foreach (string s in initialText)
     {
         Text.Add(s);
     }
     FontName  = font;
     FontColor = color;
     Padding   = 15;
     Position  = position;
     Visible   = true;
     ZIndex    = GameConstants.RENDER_INTERFACE_LEVEL;
 }