public void SetPositionInSector()
        {
            position = new Vector2(
                (int)Game.random.Next(sector.SpaceRegionArea.Left, sector.SpaceRegionArea.Right),
                (int)Game.random.Next(sector.SpaceRegionArea.Top, sector.SpaceRegionArea.Bottom));

            while (ShipAction.InRestrictedSpace(this, position))
            {
                position = new Vector2(
                    (int)Game.random.Next(sector.SpaceRegionArea.Left, sector.SpaceRegionArea.Right),
                    (int)Game.random.Next(sector.SpaceRegionArea.Top, sector.SpaceRegionArea.Bottom));
            }
        }
示例#2
0
 public void Add(ShipAction a)
 {
     Actions.Add(a);
 }