internal DanmakuSet CreateDanmakuSet(DanmakuRendererConfig config, DanmakuPool pool) { var set = new DanmakuSet(pool); var group = GetOrCreateRendererGroup(config); group.AddSet(set); return(set); }
/// <summary> /// Replaces the current /// </summary> /// <remarks> /// This destroys the original bullet, rendering it unusable. /// </remarks> /// <param name="set">the prototype </param> /// <returns></returns> public Danmaku Replace(DanmakuSet set) { var danmaku = set.Fire(new DanmakuConfig { Position = Position, Rotation = Rotation, Speed = Speed, AngularSpeed = AngularSpeed, Color = Color }); Destroy(); return(danmaku); }
internal void DestroyDanmakuSet(DanmakuSet set) { EmptyGroups = EmptyGroups ?? new List <DanmakuRendererConfig> (); foreach (var kvp in RendererGroups) { var group = kvp.Value; group.RemoveSet(set); if (group.Count <= 0) { EmptyGroups.Add(kvp.Key); } } foreach (var key in EmptyGroups) { RendererGroups.Remove(key); } EmptyGroups.Clear(); }
public bool RemoveSet(DanmakuSet set) => Sets.Remove(set);
public void AddSet(DanmakuSet set) => Sets.Add(set);