Пример #1
0
    public void Init(IEntityController entityController, IMapController map, TimeController timeController, BaseGameEvents.MonsterEvents events, List <MonsterData> monsterData)
    {
        _timeController = timeController;
        _timeController.AddScheduledEntity(this);

        _entityController = entityController;
        _map           = map;
        _monsterEvents = events;
        _monsterData   = monsterData;
    }
Пример #2
0
    protected override void DoInit(BaseEntityDependencies deps)
    {
        _monsterData = ((MonsterData)_entityData);
        name         = _monsterData.name;
        _hpTrait     = new HPTrait();
        _hpTrait.Init(this, _monsterData.HPData, deps.GameEvents.Health);

        _decisionDelay     = _monsterData.ThinkingDelay;
        _elapsedNextAction = 0.0f;
        _elapsedPathUpdate = 0.0f;

        _movingTrait = _monsterData.MovingTraitData.CreateRuntimeTrait();

        _monsterEvents = deps.GameEvents.Monsters;

        _currentState = _monsterData.InitialState;
        _currentStateTimeUnitsElapsed = 0.0f;

        _battleTrait = new BattleTrait();
        _battleTrait.Init(_entityController, _mapController, _monsterData.BattleData, this, deps.GameEvents);
    }