public FieldInfo() { Ships = new ShipList(); Shots = new ShotList(); ShipsLeft = new ShipList(); ShotsAgainst = new ShotList(); }
/// <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 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); } }
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); } }
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); }
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); }
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--; } }
public ShotListBuilder() { _shotList = WithDefaults(); }
public static ShotListDto ToDto(this ShotList shotList) { return(new ShotListDto { }); }
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)); }
/// <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); }