hovergames / avalon

Various extensions, helper and functions for cocos2d-x
Other
91 stars 37 forks source link

Define ads::Manager version 2.0 #14

Closed michaelcontento closed 8 years ago

michaelcontento commented 11 years ago

It should be based around the concept of placements. Something like:

auto manager = avalon::ads::Manager();
manager.loadFile("ads.ini");
manager.show("mainmenu");

Where ads.ini contains:

[provider.revmob.ios]
appId = XXX

[provider.chartboost.ios]
appId = XXX
appSignature = XXX

[placement.mainmenu]
type = fullscreen
weight.revmob = 1
weight.chartboost = 2

[placement.gamebanner]
type = banner
weight.revmob = 1

[placement.gamebanner.ios]
enabled = 0
  1. Default provider settings are in [provider.$NAME]
  2. Platform specific provider settings in [provider.$NAME.$PLATFORM]
  3. Placements are defined in [placement.$NAME]
  4. Currently only type is a required setting for a placement
    • The whole placement is ignored if this key is missing
  5. enabled is a optional setting for a placement, defaults to 1/true
  6. Which provider is used by the placement is controlled via weight.$PROVIDER
    • Default weight for all providers is 0
    • Weights for unknown providers are ignored
  7. Platform specific placement settings in [placement.$NAME.$PLATFORM]
michaelcontento commented 11 years ago

Currently the enabled-flag is set in avalon::ads::Manager and used for all "placements" -- which is good enough for the "remove all ads"-behaviour. But in this redesign it should be possible to control this flag on a placement level too. Example:

auto manager = avalon::ads::Manager();
manager.loadFile("ads.ini");
manager.get("mainmenu").enabled = false;

Another nice feature would be to bind a placement to a user defined function!