Package org.ngengine.ads
Class ImmersiveAdComponent
java.lang.Object
org.ngengine.ads.ImmersiveAdComponent
- All Implemented Interfaces:
Component<Object>,Fragment,LogicFragment
-
Constructor Summary
ConstructorsConstructorDescriptionImmersiveAdComponent(Collection<String> relays, org.ngengine.nostr4j.keypair.NostrPublicKey appKey, org.ngengine.nostr4j.keypair.NostrPrivateKey userAdKey) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(ImmersiveAdListener listener) protected org.ngengine.nostrads.client.services.display.AdspacegetAdSpace(ImmersiveAdSpace space) org.ngengine.nostrads.protocol.types.AdTaxonomyvoidonAdRefresh(org.ngengine.nostrads.client.negotiation.NegotiationHandler neg, org.ngengine.nostrads.protocol.negotiation.AdOfferEvent offer, String reason) voidonDisable(ComponentManager mng, Runner runner, DataStoreProvider dataStore) Called when the component is disabled.voidonEnable(ComponentManager mng, Runner runner, DataStoreProvider dataStore, boolean firstTime, Object arg) Called when the component is enabled.voidvoidregister(ImmersiveAdGroup group) voidremoveListener(ImmersiveAdListener listener) voidsetAdvertiserFilterList(List<org.ngengine.nostr4j.keypair.NostrPublicKey> advertisersList, boolean isBlackList) voidsetDefaultCategories(List<org.ngengine.nostrads.protocol.types.AdTaxonomy.Term> categories) voidsetDefaultLanguages(List<String> languages) voidsetDefaultPriceSlot(org.ngengine.nostrads.protocol.types.AdPriceSlot priceSlot) voidvoidsetViewer(ImmersiveAdViewer viewer) voidunregister(ImmersiveAdGroup group) voidupdateAppLogic(ComponentManager mng, float tpf) Called by the application logic update loop.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.ngengine.components.Component
getId, getSlot, onAttached, onDetached, onNudge
-
Constructor Details
-
ImmersiveAdComponent
public ImmersiveAdComponent(@Nullable Collection<String> relays, org.ngengine.nostr4j.keypair.NostrPublicKey appKey, @Nullable org.ngengine.nostr4j.keypair.NostrPrivateKey userAdKey)
-
-
Method Details
-
setFilter
-
setViewer
-
addListener
-
removeListener
-
refreshAll
public void refreshAll() -
setDefaultPriceSlot
public void setDefaultPriceSlot(org.ngengine.nostrads.protocol.types.AdPriceSlot priceSlot) -
setAdvertiserFilterList
public void setAdvertiserFilterList(List<org.ngengine.nostr4j.keypair.NostrPublicKey> advertisersList, boolean isBlackList) -
setDefaultCategories
public void setDefaultCategories(List<org.ngengine.nostrads.protocol.types.AdTaxonomy.Term> categories) -
setDefaultLanguages
-
getAdSpace
-
register
-
unregister
-
updateAppLogic
Description copied from interface:LogicFragmentCalled by the application logic update loop. This method is called every frame before the render phase.- Specified by:
updateAppLogicin interfaceLogicFragment- Parameters:
tpf- time per frame
-
getTaxonomy
public org.ngengine.nostrads.protocol.types.AdTaxonomy getTaxonomy() -
onEnable
public void onEnable(ComponentManager mng, Runner runner, DataStoreProvider dataStore, boolean firstTime, Object arg) Description copied from interface:ComponentCalled when the component is enabled. This is the most important method of the component lifecycle, where the component's main logic is implemented.This method is called when the component is enabled, all its dependencies are satisfied, the fragments are initialized, and the resources are loaded.
- Specified by:
onEnablein interfaceComponent<Object>- Parameters:
mng- - the ComponentManager to which this component is attachedrunner- - the Runner that executes the logicdataStore- - the DataStoreProvider for storing and retrieving data and cachesfirstTime- - whether this is the first time the component is being enabledarg- - an argument that can be passed when enabling this component, can be null
-
onDisable
Description copied from interface:ComponentCalled when the component is disabled.This should undo anything that was done in
Component.onEnable(org.ngengine.components.ComponentManager, org.ngengine.runner.Runner, org.ngengine.store.DataStoreProvider, boolean, T)and reset the component state to allow future re-enabling.This method is called when the component is explicitly disabled or when one of its dependencies is disabled.
If $
is not implemented, this method should take care of cleaning up all resources to prevent leaks.invalid reference
#onDetachIt is always called before an enabled component is detached from the
ComponentManager. -
onAdRefresh
public void onAdRefresh(org.ngengine.nostrads.client.negotiation.NegotiationHandler neg, org.ngengine.nostrads.protocol.negotiation.AdOfferEvent offer, String reason)
-