예제 #1
0
        internal DanmakuSet CreateDanmakuSet(DanmakuRendererConfig config, DanmakuPool pool)
        {
            var set   = new DanmakuSet(pool);
            var group = GetOrCreateRendererGroup(config);

            group.AddSet(set);
            return(set);
        }
예제 #2
0
        /// <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);
        }
예제 #3
0
 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();
 }
예제 #4
0
 public bool RemoveSet(DanmakuSet set) => Sets.Remove(set);
예제 #5
0
 public void AddSet(DanmakuSet set) => Sets.Add(set);