Пример #1
0
    public Ability(AbilityTemplate template, CharacterAbilityHandler abilityHandler)
    {
        Template       = template;
        AbilityHandler = abilityHandler;

        Cooldown = new AbilityCooldown(template.Cooldown);
        RegisterCanCastListeners();
    }
Пример #2
0
    public Character(CharacterTemplateSlot templateSlot, Team team,
                     CharacterActor actor, CharacterMover mover, CharacterFloatingTextHandler floatingTextHandler)
    {
        Template    = templateSlot.Template;
        actor.Owner = this;
        mover.Owner = this;
        floatingTextHandler.Owner = this;

        Team = team;

        Actor = actor;
        Mover = mover;
        FloatingTextHandler = floatingTextHandler;

        ActionPointHandler = new CharacterActionPointHandler(this);
        PositionHandler    = new CharacterPositionHandler(this, templateSlot.Position);
        AbilityHandler     = new CharacterAbilityHandler(this);
        EventHandler       = new CharacterEventHandler(this);
        StatusHandler      = new CharacterStatusHandler(this);
        HealthHandler      = new CharacterHealthHandler(this);
        AIHandler          = new CharacterAIHandler(this);

        RegisterAvailabilityListeners();
    }