Example #1
0
 /// <summary>Returns a <seealso cref="ObjectHitboxDefinition"/> that matches a given list of object IDs or <see langword="null"/> if not found.</summary>
 /// <param name="hitbox">The hitbox that the requested <seealso cref="ObjectHitboxDefinition"/> contains.</param>
 public ObjectHitboxDefinition Find(Hitbox hitbox) => list.Find(d => d.Hitbox == hitbox);
Example #2
0
 /// <summary>Sets the <seealso cref="Hitbox"/> of a specified object ID.</summary>
 /// <param name="objectID">The object ID whose <seealso cref="Hitbox"/> to set.</param>
 /// <param name="hitbox">The <seealso cref="Hitbox"/> to set.</param>
 public void SetHitbox(int objectID, Hitbox hitbox)
 {
     RemoveDefinition(objectID);
     Add(objectID, hitbox);
 }
Example #3
0
 /// <summary>Sets the <seealso cref="Hitbox"/> of a specified object ID. Returns <see langword="null"/> if the object IDs' <seealso cref="Hitbox"/> is not common. Throws respective exceptions on other errors.</summary>
 /// <param name="objectIDs">The object ID whose <seealso cref="Hitbox"/> to set.</param>
 /// <param name="hitbox">The <seealso cref="Hitbox"/> to set.</param>
 public void SetCommonHitbox(List <int> objectIDs, Hitbox hitbox)
 {
     RemoveMultipleDefinitions(objectIDs);
     Add(objectIDs, hitbox);
 }
Example #4
0
 /// <summary>Determines whether the dictionary contains an entry with the specified object IDs mapped to the specified hitbox.</summary>
 /// <param name="objectIDs">The object IDs to check whether they are mapped to the specified hitbox.</param>
 /// <param name="hitbox">The hitbox to check whether it's mapped to the specified object IDs.</param>
 public bool Contains(List <int> objectIDs, Hitbox hitbox) => list.Any(m => m.ObjectIDs.ContainsAll(objectIDs) && m.Hitbox == hitbox);
Example #5
0
 /// <summary>Adds a new <seealso cref="ObjectHitboxDefinition"/> to the dictionary.</summary>
 /// <param name="objectIDs">The object IDs to use.</param>
 /// <param name="hitbox">The <seealso cref="Hitbox"/> that will be added.</param>
 public void Add(List <int> objectIDs, Hitbox hitbox) => Add(new ObjectHitboxDefinition(objectIDs, hitbox));
Example #6
0
 /// <summary>Adds a new <seealso cref="ObjectHitboxDefinition"/> to the dictionary.</summary>
 /// <param name="objectID">The object ID to use.</param>
 /// <param name="hitbox">The <seealso cref="Hitbox"/> that will be added.</param>
 public void Add(int objectID, Hitbox hitbox) => Add(new ObjectHitboxDefinition(objectID, hitbox));
Example #7
0
 /// <summary>Initializes a new instance of the <seealso cref="ObjectHitboxDefinition"/> class.</summary>
 /// <param name="objectIDs">The object IDs that this hitbox is valid for.</param>
 /// <param name="hitbox">The hitbox of the object IDs.</param>
 public ObjectHitboxDefinition(List <int> objectIDs, Hitbox hitbox)
 {
     ObjectIDs = objectIDs;
     Hitbox    = hitbox;
 }
Example #8
0
 /// <summary>Initializes a new instance of the <seealso cref="ObjectHitboxDefinition"/> class.</summary>
 /// <param name="objectID">The object ID that this hitbox is valid for.</param>
 /// <param name="hitbox">The hitbox of the object IDs.</param>
 public ObjectHitboxDefinition(int objectID, Hitbox hitbox) : this(new List <int> {
     objectID
 }, hitbox)
 {
 }