Skip to content

Commit

Permalink
Added generic adType setup, and update GameDistribution API a bit. (#34
Browse files Browse the repository at this point in the history
)

* Added generic adType setup, and update GameDistribution API a bit.
* Build
  • Loading branch information
Ale Bles authored Aug 6, 2018
1 parent 503e4af commit b17327a
Show file tree
Hide file tree
Showing 13 changed files with 1,669 additions and 561 deletions.
4 changes: 2 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module.exports = function (grunt) {
//Typescript settings per build
ts: {
dist: {
tsconfig: './config/tsconfig.json',
tsconfig: './tsconfig.json',
src: ['ts/**/*.ts'],
dest: 'build/<%= pkg.config.name %>.js'
}
Expand Down Expand Up @@ -74,7 +74,7 @@ module.exports = function (grunt) {
tslint: {
options: {
// can be a configuration object or a filepath to tslint.json
configuration: "./config/tslint.json"
configuration: "./tslint.json"
},
dist: {
src: [
Expand Down
33 changes: 15 additions & 18 deletions build/phaser-ads.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ declare module PhaserAds {
thirdQuartile = 3,
complete = 4,
}
enum AdType {
interstitial = 0,
rewarded = 1,
banner = 2,
video = 3,
}
class AdManager extends Phaser.Plugin {
onContentPaused: Phaser.Signal;
onContentResumed: Phaser.Signal;
Expand Down Expand Up @@ -74,11 +80,6 @@ declare module PhaserAds {
Chartboost = 2,
Heyzap = 3,
}
enum CocoonAdType {
banner = 0,
interstitial = 1,
insentive = 2,
}
class CocoonAds implements IProvider {
adManager: AdManager;
adsEnabled: boolean;
Expand All @@ -87,14 +88,14 @@ declare module PhaserAds {
private bannerShowable;
private interstitial;
private interstitialShowable;
private insentive;
private insentiveShowable;
private rewarded;
private rewardedShowable;
constructor(game: Phaser.Game, provider: CocoonProvider, config?: any);
setManager(manager: AdManager): void;
showAd(adType: CocoonAdType): void;
preloadAd(adType: CocoonAdType, adId?: string, bannerPosition?: string): void;
destroyAd(adType: CocoonAdType): void;
hideAd(adType: CocoonAdType): void;
showAd(adType: AdType): void;
preloadAd(adType: AdType, adId?: string, bannerPosition?: string): void;
destroyAd(adType: AdType): void;
hideAd(adType: AdType): void;
}
}
}
Expand All @@ -106,7 +107,7 @@ declare module PhaserAds {
constructor(game: Phaser.Game, gameId: string, userId: string, debug?: boolean);
private setAdListeners();
setManager(manager: PhaserAds.AdManager): void;
showAd(adType?: GameDistributionAdType): void;
showAd(adType?: AdType): void;
preloadAd(): void;
destroyAd(): void;
hideAd(): void;
Expand Down Expand Up @@ -135,16 +136,12 @@ declare module PhaserAds {
}
declare module PhaserAds {
module AdProvider {
enum GameDistributionAdType {
preroll = 0,
midroll = 1,
}
class GameDistributionAds implements PhaserAds.AdProvider.IProvider {
adManager: AdManager;
adsEnabled: boolean;
constructor(game: Phaser.Game, gameId: string, userId: string);
constructor(game: Phaser.Game, gameId: string, userId?: string);
setManager(manager: PhaserAds.AdManager): void;
showAd(adType?: GameDistributionAdType): void;
showAd(): void;
preloadAd(): void;
destroyAd(): void;
hideAd(): void;
Expand Down
121 changes: 59 additions & 62 deletions build/phaser-ads.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/phaser-ads.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions build/phaser-ads.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit b17327a

Please sign in to comment.