Ejemplo n.º 1
0
 public FieldInfo()
 {
     Ships = new ShipList();
     Shots = new ShotList();
     ShipsLeft = new ShipList();
     ShotsAgainst = new ShotList();
 }
Ejemplo n.º 2
0
        /// <summary>
        /// This method will create a new ShotList in the shotQueue field of this controller. It will
        /// fill this ShotList with shots that this controller has available.
        /// </summary>
        private void SetShots()
        {
            shotQueue = new ShotList();

            shotQueue.MakeReceivers(AllOpponents());

            shotQueue.Invert(Match.FieldSize);
        }
Ejemplo n.º 3
0
 public FieldInfo(FieldInfo copy)
 {
     if (copy != null)
     {
         Ships = new ShipList(copy.Ships);
         Shots = new ShotList(copy.Shots);
         ShipsLeft = new ShipList(copy.ShipsLeft);
         ShotsAgainst = new ShotList(copy.ShotsAgainst);
     }
 }
Ejemplo n.º 4
0
 public Register(Register copy)
     : base(copy)
 {
     if (copy != null)
     {
         Ships = new ShipList(copy.Ships);
         ShipsLeft = new ShipList(copy.ShipsLeft);
         Shots = new ShotList(copy.Shots);
         ShotsAgainst = new ShotList(copy.ShotsAgainst);
     }
 }
Ejemplo n.º 5
0
        public float Fire()
        {
            if (CooldownCounter != Cooldown)
            {
                return(0f);
            }

            SoundEffect?.Play();
            ShotList.Add(new Shot(Shot.Texture, Position, Rotation, Shot.Duration, Shot.Speed, Shot.Damage));
            CooldownCounter = 0f;

            return(EnergyCost);
        }
Ejemplo n.º 6
0
 public bool Collision(Sprite sprite, out float damage)
 {
     for (int i = 0; i < ShotList.Count; i++)
     {
         if (!ShotList[i].Intersects(sprite))
         {
             continue;
         }
         damage = ShotList[i].Damage;
         ShotList.RemoveAt(i);
         return(true);
     }
     damage = 0;
     return(false);
 }
Ejemplo n.º 7
0
        public void UpdateShots()
        {
            for (int i = 0; i < ShotList.Count; i++)
            {
                ShotList[i].Duration--;

                ShotList[i].Position = Angle.MoveAngle(ShotList[i].Position, ShotList[i].Rotation, ShotList[i].Speed);



                if (ShotList[i].Duration > 00)
                {
                    continue;
                }
                ShotList.RemoveAt(i);
                i--;
            }
        }
Ejemplo n.º 8
0
 public ShotListBuilder()
 {
     _shotList = WithDefaults();
 }
Ejemplo n.º 9
0
 public static ShotListDto ToDto(this ShotList shotList)
 {
     return(new ShotListDto
     {
     });
 }
Ejemplo n.º 10
0
        /// <summary>
        /// This method will create a new ShotList in the shotQueue field of this controller. It will
        /// fill this ShotList with shots that this controller has available.
        /// </summary>
        private void SetShots()
        {
            shotQueue = new ShotList();

            shotQueue.MakeReceivers(AllOpponents());

            shotQueue.Invert(Match.FieldSize);
        }
 public void AddEntity(EntityShot entity)
 {
     ShotList.Add(entity);
 }
 public bool IsAddable(EntityShot entity)
 {
     return(entity.ParentEntity == ParentEntity && Property.GroupEquals(entity.Property) &&
            !ShotList.Exists(e => !e.IsDeath || World.FrameCount == e.DeathFrameNo));
 }
Ejemplo n.º 13
0
        /// <summary>
        /// This method will create a new ShotList in the shotQueue field of this controller. It will
        /// fill this ShotList with shots that this controller has available.
        /// </summary>
        private void SetShots()
        {
            //Construct a new ShotList object.
            shotQueue = new ShotList();

            //Set up our shot queue with our opponents.
            shotQueue.MakeReceivers(Register.Opponents);

            //Initially, a ShotList is empty when it is constructed, so the ShotList can be filled
            //easily by inverting it up to the size of the field in the game.
            shotQueue.Invert(Register.Match.FieldSize);
        }