Beispiel #1
0
    public InGameUser(StageEntity2 stageEntity, Status.Handle onGoldChanged, TimedConsumableCommandSet.Handle onChargedAttack)
    {
        this.stat = new Stat<PlayerStatType>(StatGenerator.ExportData<PlayerStatType>(stageEntity, new StatConstants()));
        this.status = new Status<PlayerStatusType>(null, stat);
        status.InitMinMaxVal(PlayerStatusType.exp, 0, PlayerStatType.maxEXP, 0);
        status.InitMinMaxVal(PlayerStatusType.gold, 0, PlayerStatType.maxGold, 0);
        status.InitMinMaxVal(PlayerStatusType.key, 0, PlayerStatType.maxKey, 0);
        status.InitMinMaxVal(PlayerStatusType.feverPoint, 0, PlayerStatType.maxFeverPoint, 0);

        /*
        actionHandler = new ActionHandler(status);
        AddAction(Action.E_Type.Money,
            delegate(float value, GameInstance firer, string[] param)
            {
                return new ActionHandler.Result(PlayerStatusType.gold, value);
            }
        );
        AddAction(Action.E_Type.Exp,
            delegate(float value, GameInstance firer, string[] param)
            {
                return new ActionHandler.Result(PlayerStatusType.exp, value);
            }
        );
        */

        status.RegisterOnChangeEvent(PlayerStatusType.gold, onGoldChanged);

        commandQueue = new TimedConsumableCommandSet(100, false, null, onChargedAttack);
    }
Beispiel #2
0
    public InGameUser(StageEntity stageEntity, Status.Handle onGoldChanged, TimedConsumableCommandSet.Handle onChargedAttack)
    {
        status = new Status<User>(null, null);
        actionHandler = new ActionHandler(status);

        status.InitMinMaxVal(User.Gold, 0, stageEntity.maxGold, 0);
        status.InitMinMaxVal(User.Exp, 0, stageEntity.maxEXP, 0);
        status.InitMinMaxVal(User.Key, 0, stageEntity.maxKey, 0);

        AddAction(Action.E_Type.Money,
            delegate(float value, GameInstance firer, string[] param)
            {
                return new ActionHandler.Result(User.Gold, value);
            }
        );
        AddAction(Action.E_Type.GetKey,
            delegate(float value, GameInstance firer, string[] param)
            {
                return new ActionHandler.Result(User.Key, value);
            }
        );
        AddAction(Action.E_Type.Exp,
            delegate(float value, GameInstance firer, string[] param)
            {
                return new ActionHandler.Result(User.Exp, value);
            }
        );

        status.RegisterOnChangeEvent(User.Gold, onGoldChanged);
        commandQueue = new TimedConsumableCommandSet(null, 100, false, null, onChargedAttack);
    }