예제 #1
0
        public void UpdateUI()
        {
            Animateable.UpdateAll(Engine.DeltaTime);

            tooltip = null;
            bool worldTooltip = true;

            foreach (Widget w in Widgets)
            {
                if (w.IsHovered)
                {
                    worldTooltip = false;
                    tooltip      = w.GetHovered().GetTooltip();
                }
            }

            //if no tooltip from widgets
            //if (tooltip == null)
            if (worldTooltip)
            {
                Vector2i hoveredSquare = ScreenToGrid(Engine.MousePosition);
                if (hoveredSquare != null)
                {
                    GenerateTileTooltip(Game.World.Map.At(hoveredSquare));
                }
            }
        }
예제 #2
0
파일: Unit.cs 프로젝트: Koneke/Farbase
        public Unit(
            fbWorld world,
            UnitType unitType,
            int owner,
            int id,
            int x,
            int y
            )
        {
            animateable = new Animateable(this);

            World = world;
            game  = World.Game;

            UnitType = unitType;
            Owner    = owner;
            ID       = id;
            this.x   = x;
            this.y   = y;
            Moves    = UnitType.Moves;
            Attacks  = UnitType.Attacks;
            Strength = UnitType.Strength;
        }