summaryrefslogtreecommitdiff
path: root/Plugins/MonoGame.Extended/source/MonoGame.Extended.Collisions/ISpaceAlgorithm.cs
blob: a95f7379ef5b8b6c0ce814c696fa2bcc8c43acbf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using System.Collections.Generic;

namespace MonoGame.Extended.Collisions;

/// <summary>
/// Interface, which split space for optimization of collisions.
/// </summary>
public interface ISpaceAlgorithm
{
    /// <summary>
    /// Inserts the actor into the space.
    /// The actor will have its OnCollision called when collisions occur.
    /// </summary>
    /// <param name="actor">Actor to insert.</param>
    void Insert(ICollisionActor actor);

    /// <summary>
    /// Removes the actor into the space.
    /// </summary>
    /// <param name="actor">Actor to remove.</param>
    bool Remove(ICollisionActor actor);

    /// <summary>
    /// Removes the actor into the space.
    /// The actor will have its OnCollision called when collisions occur.
    /// </summary>
    /// <param name="actor">Actor to remove.</param>
    IEnumerable<ICollisionActor> Query(RectangleF boundsBoundingRectangle);

    /// <summary>
    /// for foreach
    /// </summary>
    /// <returns></returns>
    List<ICollisionActor>.Enumerator GetEnumerator();

    /// <summary>
    /// Restructure the space with new positions.
    /// </summary>
    void Reset();
}