示例#1
0
        public bool Check(Paultangle hitBox)
        {
            var ent = EntityManager.GetEntiy <GameObject>(EntID);
            //TODO this is a brain fart i don't know the right way
            var constrant = ent.GetComponent <IHaveHitBoxCom>(RectPosAlais).HitBox;

            var result = Utils.Check(hitBox, constrant, Type, Inside);

            LastResult = result;

            return(result);
        }
示例#2
0
 public bool Check(Paultangle hitBox)
 {
     return(EntityManager.GetAllEntsWithTag(Tag).All
            (
                i =>
                Utils.Check
                (
                    hitBox,
                    EntityManager.GetEntiy <GameObject>(i).GetComponent <IHaveHitBoxCom>("pos").HitBox,
                    Type,
                    Inside
                )
            ));
 }
示例#3
0
        public void Render(double deltaTime)
        {
            var ent             = EntityManager.GetEntiy <GameObject>(EntID);
            var outlineColorCom = ent.GetComponent <ColorValueCom>(OutlineColorAlias);
            var barColorCom     = ent.GetComponent <ColorValueCom>(BarColorAlias);
            var rectPosCom      = ent.GetComponent <IHaveHitBoxCom>(RectPosAlais);
            var timerCom        = ent.GetComponent <TimerCom>(TimerValueAlias);

            var timeRectangle = new Paultangle(rectPosCom.HitBox);

            timeRectangle.Width = (timerCom.Value / timerCom.EndTime) * timeRectangle.Width;

            ShapeExtensions.FillRectangle(SpriteBatch, timeRectangle.ToRectangleF(), barColorCom.Value);

            ShapeExtensions.DrawRectangle(SpriteBatch, rectPosCom.HitBox.ToRectangleF(), outlineColorCom.Value, (float)Thickness);
        }
示例#4
0
文件: Grid.cs 项目: sardap/VFVGAVFAF
        public void Insert(Paultangle paultangle, long id, List <string> tags)
        {
            if (paultangle.Width > 0 && paultangle.Height > 0)
            {
                int left   = Math.Max((int)Math.Floor(paultangle.Left / CELL_SIZE), 0);
                int top    = Math.Max((int)Math.Floor(paultangle.Top / CELL_SIZE), 0);
                int right  = Math.Min((int)Math.Floor(paultangle.Right / CELL_SIZE), GRID_WIDTH);
                int bottom = Math.Min((int)Math.Floor(paultangle.Bottom / CELL_SIZE), GRID_HEIGHT);

                _idCellMap.Add(id, new List <CellPostion>());

                for (int y = top; y < bottom; y++)
                {
                    for (int x = left; x < right; x++)
                    {
                        Cells[y][x].Conatins.Add(id);
                        Cells[y][x].CollectiveTags.AddRange(tags);
                        _idCellMap[id].Add(new CellPostion(y, x));
                    }
                }
            }
        }
示例#5
0
 public RectPosCom(Rectangle rectangle)
 {
     PostionConstrantComs = new List <string>();
     Paultangle           = new Paultangle(rectangle);
     _startingPostion     = new Paultangle(Paultangle);
 }
示例#6
0
 public RectPosCom()
 {
     Paultangle       = new Paultangle();
     _startingPostion = new Paultangle(Paultangle);
 }