C# Класс MegaMan.Engine.CollisionComponent

Наследование: MegaMan.Engine.Component
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
AddBox ( MegaMan.Engine.CollisionBox box ) : void
CheckIfOneEntityHitContainProperty ( string property ) : bool

Function to check collision with solid objects which occured during game tick.

CheckIfOneEntityHitContainProperty_RealTime ( string property ) : bool

Function to check RealTime collision with solid objects. (not in game loop). CollisionWithAllEntities_RealTime Must have been called before.

CheckIfOneTileHitContainProperty ( string property ) : bool

Function to check collisions with tiles that occured during tick.

CheckIfOneTileHitContainProperty_RealTime ( string property ) : bool

Function to check RealTime collision (not in game loop). CollisionWithTiles_RealTime Must have been called before.

Clone ( ) : MegaMan.Engine.Component
CollisionWithAllEntitiesAndTiles_RealTime ( string boxName, string entity, string property, bool pushAway, bool solidOnly, bool checkTilesForCollisions, bool checkEntitiesForCollisions ) : bool

Function that checks collision with tiles and/or entities. Stops the checks as soon as one collision is found

IF MANY ENTITIES, ONLY FIRST ON IN LIST IS CHECKED

Message ( IGameMessage msg ) : void
RegisterDependencies ( MegaMan.Engine.Component component ) : void
Start ( IGameplayContainer container ) : void
Stop ( IGameplayContainer container ) : void
TouchedAt ( string myGroup, string targetGroup = null ) : bool
TouchedBy ( string group ) : bool
VerticalApproach ( RectangleF intersection, RectangleF boundBox, float vx, float vy ) : bool

Защищенные методы

Метод Описание
Update ( ) : void

Приватные методы

Метод Описание
BlockByIntersection ( RectangleF myBox, RectangleF targetBox, bool uponly, bool downonly ) : bool
CheckEntityCollisions ( List blockEntities, MegaMan.Engine.CollisionBox hitbox, RectangleF boundbox, bool pushAway = true, bool solidOnly = true ) : RectangleF
CheckEnvironment ( List hitSquares, MegaMan.Engine.CollisionBox hitbox, bool pushAway = true ) : void
CheckEnvironmentTile ( List hitSquares, MegaMan.Engine.CollisionBox hitbox, RectangleF hitRect, MapSquare tile, PointF &offset, bool pushAway ) : void
CheckTargetBox ( MegaMan.Engine.CollisionBox hitbox, RectangleF boundBox, IEntity entity, CollisionComponent coll, MegaMan.Engine.CollisionBox targetBox ) : RectangleF
CheckTileProperty ( TileProperties tileProperty, string property ) : bool

See returns

ClearTouch ( ) : void
CollideWith ( IEntity entity, MegaMan.Engine.CollisionBox myBox, MegaMan.Engine.CollisionBox targetBox ) : void
CollisionBoxToCheck ( string boxName, string entityId ) : List

Returns list of boxes to check. If boxName is nulled, fetch active boxes of entity, else only return boxName.

CollisionWithAllEntities_RealTime ( MegaMan.Engine.CollisionBox box, string property, bool solidOnly = true, bool pushAway = false ) : bool

See return value. Fills hitBlockEntities with all/solid (see param solidOnly) entities hit

CollisionWithTiles_RealTime ( MegaMan.Engine.CollisionBox box, string property, bool pushAway = false ) : bool

See return value. Fills hitSquaresForFunctionThatChecksCollisions with blocks hit

FloatCorrect ( RectangleF rect ) : RectangleF
HitByBoxes ( MegaMan.Engine.CollisionBox hitbox ) : IEnumerable

Get the hitboxes that the calling box would be targeted by - use for blocking

Instance_GameRender ( GameRenderEventArgs e ) : void
Loadinfo ( CollisionComponentInfo info ) : void
ReactForHitbox ( List hitSquares, HashSet hitTypes, MegaMan.Engine.CollisionBox hitbox ) : void
ReactToTileEffect ( TileProperties properties ) : void
TargetBoxes ( MegaMan.Engine.CollisionBox hitbox ) : IEnumerable

Get the hitboxes that the calling box can target

Touch ( MegaMan.Engine.CollisionBox targetbox, MegaMan.Engine.CollisionBox mybox ) : void

Описание методов

AddBox() публичный Метод

public AddBox ( MegaMan.Engine.CollisionBox box ) : void
box MegaMan.Engine.CollisionBox
Результат void

CheckIfOneEntityHitContainProperty() публичный Метод

Function to check collision with solid objects which occured during game tick.
public CheckIfOneEntityHitContainProperty ( string property ) : bool
property string
Результат bool

CheckIfOneEntityHitContainProperty_RealTime() публичный Метод

Function to check RealTime collision with solid objects. (not in game loop). CollisionWithAllEntities_RealTime Must have been called before.
public CheckIfOneEntityHitContainProperty_RealTime ( string property ) : bool
property string
Результат bool

CheckIfOneTileHitContainProperty() публичный Метод

Function to check collisions with tiles that occured during tick.
public CheckIfOneTileHitContainProperty ( string property ) : bool
property string
Результат bool

CheckIfOneTileHitContainProperty_RealTime() публичный Метод

Function to check RealTime collision (not in game loop). CollisionWithTiles_RealTime Must have been called before.
public CheckIfOneTileHitContainProperty_RealTime ( string property ) : bool
property string
Результат bool

Clone() публичный Метод

public Clone ( ) : MegaMan.Engine.Component
Результат MegaMan.Engine.Component

CollisionWithAllEntitiesAndTiles_RealTime() публичный Метод

Function that checks collision with tiles and/or entities. Stops the checks as soon as one collision is found
IF MANY ENTITIES, ONLY FIRST ON IN LIST IS CHECKED
public CollisionWithAllEntitiesAndTiles_RealTime ( string boxName, string entity, string property, bool pushAway, bool solidOnly, bool checkTilesForCollisions, bool checkEntitiesForCollisions ) : bool
boxName string If null, pick every active box of entity picked
entity string If null, current entity
property string Example: Blocking
pushAway bool If a collision is found, need to push entity away?
solidOnly bool Applies to entities. Check only solid ones?
checkTilesForCollisions bool
checkEntitiesForCollisions bool
Результат bool

Message() публичный Метод

public Message ( IGameMessage msg ) : void
msg IGameMessage
Результат void

RegisterDependencies() публичный Метод

public RegisterDependencies ( MegaMan.Engine.Component component ) : void
component MegaMan.Engine.Component
Результат void

Start() публичный Метод

public Start ( IGameplayContainer container ) : void
container IGameplayContainer
Результат void

Stop() публичный Метод

public Stop ( IGameplayContainer container ) : void
container IGameplayContainer
Результат void

TouchedAt() публичный Метод

public TouchedAt ( string myGroup, string targetGroup = null ) : bool
myGroup string
targetGroup string
Результат bool

TouchedBy() публичный Метод

public TouchedBy ( string group ) : bool
group string
Результат bool

Update() защищенный Метод

protected Update ( ) : void
Результат void

VerticalApproach() публичный статический Метод

public static VerticalApproach ( RectangleF intersection, RectangleF boundBox, float vx, float vy ) : bool
intersection RectangleF
boundBox RectangleF
vx float
vy float
Результат bool