public void MoveObjects() { //make the Bird fall Bird.Fall(_gravity); //make the Pipe mode //Pipe.Move(_speed); //Move each pipe in the collection of pipes //foreach(var pipe in Pipes) //{ // pipe.Move(_speed); //} Pipes.ForEach(x => x.Move(_speed)); //shorthand }
/// <summary> /// Injects the time into each measurement. /// </summary> /// <param name="date">The time at which the measurement was taken.</param> public void AddDates(DateTime date) { Houses.ForEach((House house) => house.CreatedAt = date); Pipes.ForEach((Pipe pipe) => pipe.CreatedAt = date); Sources.ForEach((Source source) => source.CreatedAt = date); }
public Task Add(IEnumerable <IData> datas, bool binding = false) => Task.Run(() => datas.Split(Buffer, true). ForEach(d => Pipes.ForEach(pipe => pipe.Add(d, binding))));
private void MoveObjects() { Bird.Fall(_gravity); Pipes.ForEach((pipe) => pipe.Move()); }