Beispiel #1
0
        public override void VisitStart(World world)
        {
            base.VisitStart(world);

            CJMenuLayer startPage = new CJMenuLayer();

            BackgroundLayer background = new BackgroundLayer();
            //EntityLayer entityLayer = new EntityLayer();
            BoardGameLayer boardGameLayer = new BoardGameLayer();

            boardGameLayer.ParentLayer = background;

            BoardPlayerLayer boardPlayerLayer   = new BoardPlayerLayer();
            BoardPlayerLayer boardOpponentLayer = new BoardPlayerLayer();

            BoardNotifLayer boardNotifLayer = new BoardNotifLayer();

            BoardBannerLayer bannerLayer = new BoardBannerLayer();

            world.InitializeWorld(new List <Tuple <string, ALayer> >()
            {
                new Tuple <string, ALayer>("startPage", startPage),

                new Tuple <string, ALayer>("VsO7nJK", background),
                new Tuple <string, ALayer>("gameLayer", boardGameLayer),
                new Tuple <string, ALayer>("playerLayer", boardPlayerLayer),
                new Tuple <string, ALayer>("opponentLayer", boardOpponentLayer),
                new Tuple <string, ALayer>("notifLayer", boardNotifLayer),
                new Tuple <string, ALayer>("bannerLayer", bannerLayer)
            });

            this.nextLevelNodeName = "StartPageLevel";
            this.UpdateCurrentLevelNode(world);
        }
        //protected override Vector2f DefaultViewSize
        //{
        //    set
        //    {
        //        if (value != this.DefaultViewSize)
        //        {
        //            base.DefaultViewSize = value;

        //            IntRect endTurnButtonCanvevas = this.endTurnButton.Canevas;
        //            this.endTurnButton.Position = new Vector2f(-endTurnButtonCanvevas.Width / 2, this.DefaultViewSize.Y / 2 - endTurnButtonCanvevas.Height);

        //            IntRect effectBehaviorLabelCanvevas = this.effectBehaviorLabel2D.Canevas;
        //            this.effectBehaviorLabel2D.StartingPosition = new Vector2f(-this.DefaultViewSize.X / 2 - effectBehaviorLabelCanvevas.Width, 0);
        //        }
        //    }
        //}

        public BoardNotifLayer2D(World2D world2D, IObject2DFactory factory, BoardNotifLayer layer) :
            base(world2D, factory, layer)
        {
            this.Area = new Vector2i(int.MaxValue, int.MaxValue);

            this.hittableEntities2D = new List <AEntity2D>();

            this.awakenedBannerLabel2D = new AwakenedBannerLabel2D(this);
            this.effectBanner2D        = new EffectBanner2D(this);

            this.effectLabel2D = new EffectLabel2D(this);

            this.endTurnButton         = new EndTurnButton2D(this);
            this.effectBehaviorLabel2D = new EffectBehaviorLabel2D(this);

            this.pendingRemovingCardEntities = new List <CardEntity2D>();

            this.cardsHand = new List <CardEntity2D>();

            layer.CardCreated += OnCardCreated;
            layer.CardRemoved += OnCardRemoved;

            layer.CardPicked   += OnCardPicked;
            layer.CardUnpicked += OnCardUnpicked;

            layer.CardFocused += OnCardFocused;

            layer.CardAwakened += OnCardAwakened;

            layer.NotifBehaviorStarted      += OnNotifBehaviorStarted;
            layer.NotifBehaviorPhaseChanged += OnNotifBehaviorPhaseChanged;
            layer.NotifBehaviorUseChanged   += OnNotifBehaviorUseChanged;
            layer.NotifBehaviorEnded        += OnNotifBehaviorEnded;
        }
Beispiel #3
0
        public override IObject2D CreateObject2D(World2D world2D, IObject obj)
        {
            if (obj is BoardNotifLayer)
            {
                BoardNotifLayer boardNotifLayer = obj as BoardNotifLayer;

                return(new BoardNotifLayer2D(world2D, this, boardNotifLayer));
            }

            return(null);
        }
        public override IAIObject CreateObjectAI(AIWorld worldAI, IObject obj)
        {
            if (obj is BoardNotifLayer)
            {
                BoardNotifLayer boardPlayerLayer = obj as BoardNotifLayer;

                return(new AIBoardNotifLayer(worldAI, this, boardPlayerLayer));
            }

            return(null);
        }
Beispiel #5
0
        public CardEntity PickCard(BoardNotifLayer boardNotifLayer, CardEntity cardPicked)
        {
            if (this.BoardGameLayer.CardEntityPicked == null)
            {
                if (boardNotifLayer.PickCard(cardPicked))
                {
                    return(this.BoardGameLayer.PickCard(cardPicked.Card));
                }
                this.BoardGameLayer.PickCard(cardPicked);
            }

            return(null);
        }
Beispiel #6
0
        public CardEntity UnpickCard(BoardNotifLayer boardNotifLayer, string detailUnpicked)
        {
            if (this.BoardGameLayer.CardEntityPicked != null)
            {
                Card.Card cardToUnpick  = this.BoardGameLayer.CardEntityPicked.Card;
                Vector2f  startPosition = GetPositionFrom(detailUnpicked);

                if (this.BoardGameLayer.UnPickCard() && boardNotifLayer != null)
                {
                    return(boardNotifLayer.UnpickCard(cardToUnpick, startPosition));
                }
            }

            return(null);
        }
Beispiel #7
0
        public AIBoardNotifLayer(AIWorld world2D, IAIObjectFactory layerFactory, BoardNotifLayer layer)
            : base(world2D, layerFactory, layer)
        {
            this.CardsHand = new List <AICardEntity>();

            layer.CardCreated += OnCardCreated;
            layer.CardRemoved += OnCardRemoved;

            layer.CardPicked   += OnCardPicked;
            layer.CardUnpicked += OnCardUnpicked;

            layer.CardFocused += OnCardFocused;

            layer.CardAwakened += OnCardAwakened;

            layer.NotifBehaviorStarted      += OnNotifBehaviorStarted;
            layer.NotifBehaviorPhaseChanged += OnNotifBehaviorPhaseChanged;
            layer.NotifBehaviorUseChanged   += OnNotifBehaviorUseChanged;
            layer.NotifBehaviorEnded        += OnNotifBehaviorEnded;
        }
Beispiel #8
0
        public override void VisitStart(World world)
        {
            base.VisitStart(world);

            BackgroundLayer      background      = new BackgroundLayer();
            ImageBackgroundLayer imageBackground = new ImageBackgroundLayer();

            BoardGameLayer boardGameLayer = new BoardGameLayer();

            boardGameLayer.ParentLayer = background;

            BoardPlayerLayer     boardPlayerLayer   = new BoardPlayerLayer();
            BoardPlayerLayer     boardOpponentLayer = new BoardPlayerLayer();
            MenuBoardPlayerLayer menuPlayerLayer    = new MenuBoardPlayerLayer();

            BoardNotifLayer     boardNotifLayer     = new BoardNotifLayer();
            MenuBoardNotifLayer menuBoardNotifLayer = new MenuBoardNotifLayer();

            BoardBannerLayer bannerLayer = new BoardBannerLayer();

            MenuTextLayer menuTextLayer = new MenuTextLayer();

            menuTextLayer.ParentLayer = background;

            world.InitializeWorld(new List <Tuple <string, ALayer> >()
            {
                new Tuple <string, ALayer>("backgroundLayer", background),
                new Tuple <string, ALayer>("slidesLayer", imageBackground),
                new Tuple <string, ALayer>("menuTextLayer", menuTextLayer),
                new Tuple <string, ALayer>("gameLayer", boardGameLayer),
                new Tuple <string, ALayer>("playerLayer", boardPlayerLayer),
                new Tuple <string, ALayer>("opponentLayer", boardOpponentLayer),
                new Tuple <string, ALayer>("menuPlayerLayer", menuPlayerLayer),
                new Tuple <string, ALayer>("notifLayer", boardNotifLayer),
                new Tuple <string, ALayer>("menuNotifLayer", menuBoardNotifLayer),
                new Tuple <string, ALayer>("bannerLayer", bannerLayer)
            });

            this.nextLevelNodeName = "StartPageLevel";
            this.UpdateCurrentLevelNode(world);
        }
Beispiel #9
0
 public MenuBoardNotifLayer2D(World2D world2D, IObject2DFactory factory, BoardNotifLayer layer)
     : base(world2D, factory, layer)
 {
 }