Last active
August 29, 2015 14:13
-
-
Save quabug/fa7e43b2bb378d30e9a2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UMGameAgent: | |
var agent | |
func _init(agent): | |
self.agent = agent | |
func startLevel(var level): | |
agent.startLevel(level) | |
func failLevel(var level): | |
agent.failLevel(level) | |
func finishLevel(var level): | |
agent.finishLevel(level) | |
func pay_coin(var money, var coin, var source): | |
agent.pay(money, coin, source) | |
func pay_item(var money, var item, var number, var price, var source): | |
agent.pay(money, item, number, price, source) | |
func buy(var item, var number, var price): | |
agent.buy(item, number, price) | |
func use(var item, var number, var price): | |
agent.use(item, number, price) | |
func bonus_coin(var coin, var trigger): | |
agent.bonus_coin(coin, trigger) | |
func bonus_item(var item, var number, var price,var trigger): | |
agent.bonus_item(item, number, price, trigger) | |
func setPlayerInfo(var id, var age, var gender, var source): | |
agent.setPlayerInfo(id, age, gender, source) | |
func flush(): | |
agent.flush() | |
func reportError(var error): | |
agent.reportError(error) | |
class PrintAgent: | |
func startLevel(var level): | |
print("startLevel", " level=", level) | |
func failLevel(var level): | |
print("failLevel", " level=", level) | |
func finishLevel(var level): | |
print("finishLevel", " level=", level) | |
func pay_coin(var money, var coin, var source): | |
print("pay", " money=", money, " coin=", coin, " source=", source) | |
func pay_item(var money, var item, var number, var price, var source): | |
print("pay", " money=", money, " item=", item, " number=", number, " price=", price, " source=", source) | |
func buy(var item, var number, var price): | |
print("buy", " item=", item, " number=", number, " price=", price) | |
func use(var item, var number, var price): | |
print("use", " item=", item, " number=", number, " price=", price) | |
func bonus_coin(var coin, var trigger): | |
print("bonus_coin", " coin=", coin, " trigger=", trigger) | |
func bonus_item(var item, var number, var price,var trigger): | |
print("bonus_item", " item=", item, " number=", number, " price=", price, " trigger=", trigger) | |
func setPlayerInfo(var id, var age, var gender, var source): | |
print("setPlayerInfo", " id=", id, " age=", age, " gender=", gender, " source=", source) | |
func flush(): | |
print("flush") | |
func reportError(var error): | |
print("reportError", " error=", error) | |
var wrapper | |
func _init(): | |
var umgame = Globals.get_singleton("UMGameAgent") | |
if umgame == null: | |
wrapper = PrintAgent.new() | |
print("create PrintAgent for UMGameAgent") | |
else: | |
wrapper = UMGameAgent.new(umgame) | |
print("create UMGameAgent") | |
func startLevel(var level): | |
wrapper.startLevel(level) | |
func failLevel(var level): | |
wrapper.failLevel(level) | |
func finishLevel(var level): | |
wrapper.finishLevel(level) | |
func pay_coin(var money, var coin, var source): | |
wrapper.pay_coin(money, coin, source) | |
func pay_item(var money, var item, var number, var price, var source): | |
wrapper.pay_item(money, item, number, price, source) | |
func buy(var item, var number, var price): | |
wrapper.buy(item, number, price) | |
func use(var item, var number, var price): | |
wrapper.use(item, number, price) | |
func bonus_coin(var coin, var trigger): | |
wrapper.bonus_coin(coin, trigger) | |
func bonus_item(var item, var number, var price,var trigger): | |
wrapper.bonus_item(item, number, price, trigger) | |
func setPlayerInfo(var id, var age, var gender, var source): | |
wrapper.setPlayerInfo(id, age, gender, source) | |
func flush(): | |
wrapper.flush() | |
func reportError(var error): | |
wrapper.reportError(error) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment