VelocitySystems class
Пакет: com.hypixel.hytale.server.core.modules.physics.systems
Файл: com/hypixel/hytale/server/core/modules/physics/systems/VelocitySystems.java
Поля (2)
| Модификаторы | Тип | Имя |
|---|---|---|
|
private final Query<EntityStore> |
query |
|
private final ComponentType<EntityStore, Velocity> |
velocityComponentType |
Методы (4)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
|
public |
AddSystempublic AddSystem(ComponentType<EntityStore, Velocity> var1) |
|
public Query<EntityStore> |
getQuerypublic Query<EntityStore> getQuery() |
|
public void |
onEntityAddpublic void onEntityAdd(@Nonnull Holder<EntityStore> var1, @Nonnull AddReason var2, @Nonnull Store<EntityStore> var3) |
|
public void |
onEntityRemovedpublic void onEntityRemoved(@Nonnull Holder<EntityStore> var1, @Nonnull RemoveReason var2, @Nonnull Store<EntityStore> var3) |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.server.core.modules.physics.systems;
class="kw">import com.hypixel.hytale.component.AddReason;
class="kw">import com.hypixel.hytale.component.ComponentType;
class="kw">import com.hypixel.hytale.component.Holder;
class="kw">import com.hypixel.hytale.component.RemoveReason;
class="kw">import com.hypixel.hytale.component.Store;
class="kw">import com.hypixel.hytale.component.query.Query;
class="kw">import com.hypixel.hytale.component.system.HolderSystem;
class="kw">import com.hypixel.hytale.server.core.modules.entity.AllLegacyEntityTypesQuery;
class="kw">import com.hypixel.hytale.server.core.modules.physics.component.Velocity;
class="kw">import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
class="kw">import javax.annotation.Nonnull;
class="kw">public class VelocitySystems {
class="kw">public VelocitySystems() {
}
class="kw">public class="kw">static class AddSystem class="kw">extends HolderSystem<EntityStore> {
class="kw">private class="kw">final ComponentType<EntityStore, Velocity> velocityComponentType;
@Nonnull
class="kw">private class="kw">final Query<EntityStore> query;
class="kw">public AddSystem(ComponentType<EntityStore, Velocity> var1) {
this.velocityComponentType = var1;
this.query = Query.and(AllLegacyEntityTypesQuery.INSTANCE, Query.not(var1));
}
@Override
class="kw">public void onEntityAdd(@Nonnull Holder<EntityStore> var1, @Nonnull AddReason var2, @Nonnull Store<EntityStore> var3) {
var1.ensureComponent(this.velocityComponentType);
}
@Override
class="kw">public void onEntityRemoved(@Nonnull Holder<EntityStore> var1, @Nonnull RemoveReason var2, @Nonnull Store<EntityStore> var3) {
}
@Nonnull
@Override
class="kw">public Query<EntityStore> getQuery() {
class="kw">return this.query;
}
}
}