Exemplo n.º 1
0
        public SkillsManager(ILogger <SkillsManager> logger, IGameDefinitionsPreloder definitionsPreloder, IDatabase database, IHealthManager healthManager, IAttackManager attackManager, IBuffsManager buffsManager, IStatsManager statsManager, IElementProvider elementProvider, ICountryProvider countryProvider, ICharacterConfiguration characterConfig, ILevelProvider levelProvider, IAdditionalInfoManager additionalInfoManager, IMapProvider mapProvider, ITeleportationManager teleportationManager, IMovementManager movementManager, IShapeManager shapeManager, IPartyManager partyManager, IGamePacketFactory packetFactory)
        {
            _logger = logger;
            _definitionsPreloder      = definitionsPreloder;
            _database                 = database;
            _healthManager            = healthManager;
            _attackManager            = attackManager;
            _buffsManager             = buffsManager;
            _statsManager             = statsManager;
            _elementProvider          = elementProvider;
            _countryProvider          = countryProvider;
            _characterConfig          = characterConfig;
            _levelProvider            = levelProvider;
            _additionalInfoManager    = additionalInfoManager;
            _mapProvider              = mapProvider;
            _teleportationManager     = teleportationManager;
            _movementManager          = movementManager;
            _shapeManager             = shapeManager;
            _partyManager             = partyManager;
            _packetFactory            = packetFactory;
            _levelProvider.OnLevelUp += OnLevelUp;

#if DEBUG
            _logger.LogDebug("SkillsManager {hashcode} created", GetHashCode());
#endif
        }
Exemplo n.º 2
0
    /// <summary>
    /// Used to check if there is free space for the next moove using existing shaped from shapeManager
    ///
    /// At this point we check only for for different positions, not rotations
    /// </summary>
    /// <param name="shapeManager"></param>
    /// <returns>returns false if there is no place for existing shapes</returns>
    public bool MoreMoovesPossible(IShapeManager shapeManager)
    {
        // For each shape
        for (int i = 0; i < shapeManager.shapeArray.Length; i++)
        {
            if (!shapeManager.shapeToBeDestroyed[i])
            {
                Shape shape = (Shape)shapeManager.shapeArray[i];
                // For each position
                for (int x = 0; x < matrix.Length; x++)
                {
                    for (int y = 0; y < matrix[0].Length; y++)
                    {
                        MatrixManager matrixManagerCopy = new MatrixManager(matrix.Length, matrix[0].Length);
                        matrixManagerCopy.matrix = Helper.GetArr(matrix.Length, matrix[0].Length);
                        for (int mX = 0; mX < matrix.Length; mX++)
                        {
                            for (int mY = 0; mY < matrix[0].Length; mY++)
                            {
                                matrixManagerCopy.matrix[mX][mY] = matrix[mX][mY];
                            }
                        }

                        if (matrixManagerCopy.AddShape(shape, x, y))
                        {
                            return(true);
                        }
                    }
                }
            }
        }

        return(false);
    }
Exemplo n.º 3
0
 public void CleanupShapeManager()
 {
     if (mShapeManager != null)
     {
         mShapeManager.OnRefreshShow        -= new ShapeEventHandler(DoRefreshShow);
         mShapeManager.OnActiveShapeChanged -= new ShapeEventHandler(DoActiveShapeChanged);
         mShapeManager.OnShapeStateChanged  -= new ShapeStateChangedHandler(DoShapeStateChanged);
         mShapeManager = null;
     }
 }
Exemplo n.º 4
0
        public void InitShapeManager <T>()
            where T : IShape, new()
        {
            if (mShapeManager == null)
            {
                mShapeManager = new CShapeManager <T, IShape>();
                mShapeManager.OnRefreshShow        += new ShapeEventHandler(DoRefreshShow);
                mShapeManager.OnActiveShapeChanged += new ShapeEventHandler(DoActiveShapeChanged);
                mShapeManager.OnShapeStateChanged  += new ShapeStateChangedHandler(DoShapeStateChanged);

                mShapeManager.CanvasWidth  = pictureBox_shape.Width;
                mShapeManager.CanvasHeight = pictureBox_shape.Height;
            }
        }
Exemplo n.º 5
0
        public AttackManager(ILogger <AttackManager> logger, IStatsManager statsManager, ILevelProvider levelProvider, IElementProvider elementManager, ICountryProvider countryProvider, ISpeedManager speedManager, IStealthManager stealthManager, IHealthManager healthManager, IShapeManager shapeManager)
        {
            _logger          = logger;
            _statsManager    = statsManager;
            _levelProvider   = levelProvider;
            _elementManager  = elementManager;
            _countryProvider = countryProvider;
            _speedManager    = speedManager;
            _stealthManager  = stealthManager;
            _healthManager   = healthManager;
            _shapeManager    = shapeManager;

#if DEBUG
            _logger.LogDebug("AttackManager {hashcode} created", GetHashCode());
#endif
        }
Exemplo n.º 6
0
        public Character(ILogger <Character> logger,
                         IDatabasePreloader databasePreloader,
                         IGuildManager guildManager,
                         ICountryProvider countryProvider,
                         ISpeedManager speedManager,
                         IStatsManager statsManager,
                         IAdditionalInfoManager additionalInfoManager,
                         IHealthManager healthManager,
                         ILevelProvider levelProvider,
                         ILevelingManager levelingManager,
                         IInventoryManager inventoryManager,
                         IStealthManager stealthManager,
                         IAttackManager attackManager,
                         ISkillsManager skillsManager,
                         IBuffsManager buffsManager,
                         IElementProvider elementProvider,
                         IKillsManager killsManager,
                         IVehicleManager vehicleManager,
                         IShapeManager shapeManager,
                         IMovementManager movementManager,
                         ILinkingManager linkinManager,
                         IMapProvider mapProvider,
                         ITeleportationManager teleportationManager,
                         IPartyManager partyManager,
                         ITradeManager tradeManager,
                         IFriendsManager friendsManager,
                         IDuelManager duelManager,
                         IBankManager bankManager,
                         IQuestsManager questsManager,
                         IUntouchableManager untouchableManager,
                         IWarehouseManager warehouseManager,
                         IShopManager shopManager,
                         ISkillCastingManager skillCastingManager,
                         ICastProtectionManager castProtectionManager,
                         IGameSession gameSession,
                         IGamePacketFactory packetFactory) : base(databasePreloader, countryProvider, statsManager, healthManager, levelProvider, buffsManager, elementProvider, movementManager, untouchableManager, mapProvider)
        {
            _logger        = logger;
            _packetFactory = packetFactory;

            AdditionalInfoManager = additionalInfoManager;
            InventoryManager      = inventoryManager;
            StealthManager        = stealthManager;
            LevelingManager       = levelingManager;
            SpeedManager          = speedManager;
            AttackManager         = attackManager;
            SkillsManager         = skillsManager;
            KillsManager          = killsManager;
            VehicleManager        = vehicleManager;
            ShapeManager          = shapeManager;
            LinkingManager        = linkinManager;
            TeleportationManager  = teleportationManager;
            PartyManager          = partyManager;
            TradeManager          = tradeManager;
            FriendsManager        = friendsManager;
            DuelManager           = duelManager;
            GuildManager          = guildManager;
            BankManager           = bankManager;
            QuestsManager         = questsManager;
            WarehouseManager      = warehouseManager;
            ShopManager           = shopManager;
            SkillCastingManager   = skillCastingManager;
            CastProtectionManager = castProtectionManager;
            GameSession           = gameSession;

            HealthManager.MP_SP_Used += SendUseMPSP;
            HealthManager.OnCurrentHitpointsChanged += SendCurrentHitpoints;
            StatsManager.OnAdditionalStatsUpdate    += SendAdditionalStats;
            StatsManager.OnResetStats         += SendResetStats;
            BuffsManager.OnBuffAdded          += SendAddBuff;
            BuffsManager.OnBuffRemoved        += SendRemoveBuff;
            AttackManager.OnStartAttack       += SendAttackStart;
            VehicleManager.OnUsedVehicle      += SendUseVehicle;
            SkillsManager.OnResetSkills       += SendResetSkills;
            InventoryManager.OnAddItem        += SendAddItemToInventory;
            InventoryManager.OnRemoveItem     += SendRemoveItemFromInventory;
            InventoryManager.OnItemExpired    += SendItemExpired;
            AttackManager.TargetOnBuffAdded   += SendTargetAddBuff;
            AttackManager.TargetOnBuffRemoved += SendTargetRemoveBuff;
            DuelManager.OnDuelResponse        += SendDuelResponse;
            DuelManager.OnStart                   += SendDuelStart;
            DuelManager.OnCanceled                += SendDuelCancel;
            DuelManager.OnFinish                  += SendDuelFinish;
            LevelingManager.OnExpChanged          += SendExperienceGain;
            QuestsManager.OnQuestMobCountChanged  += SendQuestCountUpdate;
            QuestsManager.OnQuestFinished         += SendQuestFinished;
            ShopManager.OnUseShopClosed           += SendUseShopClosed;
            ShopManager.OnUseShopItemCountChanged += SendUseShopItemCountChanged;
            ShopManager.OnSoldItem                += SendSoldItem;

            Bless.Instance.OnDarkBlessChanged  += OnDarkBlessChanged;
            Bless.Instance.OnLightBlessChanged += OnLightBlessChanged;
        }
Exemplo n.º 7
0
 public void Setup()
 {
     _shapeManager = new ShapeManager();
 }
Exemplo n.º 8
0
 public CharacterFactory(ILogger <ICharacterFactory> logger,
                         IDatabase database,
                         ILogger <Character> characterLogger,
                         IGameWorld gameWorld,
                         IDatabasePreloader databasePreloader,
                         IGameDefinitionsPreloder definitionsPreloder,
                         ICountryProvider countryProvider,
                         ISpeedManager speedManager,
                         IStatsManager statsManager,
                         IHealthManager healthManager,
                         ILevelProvider levelProvider,
                         ILevelingManager levelingManager,
                         IInventoryManager inventoryManager,
                         ILinkingManager linkingManager,
                         IGuildManager guildManager,
                         IGameSession gameSession,
                         IStealthManager stealthManager,
                         IAttackManager attackManager,
                         ISkillsManager skillsManager,
                         IBuffsManager buffsManager,
                         IElementProvider elementProvider,
                         IKillsManager killsManager,
                         IVehicleManager vehicleManager,
                         IShapeManager shapeManager,
                         IMovementManager movementManager,
                         IAdditionalInfoManager additionalInfoManager,
                         IMapProvider mapProvider,
                         ITeleportationManager teleportationManager,
                         IPartyManager partyManager,
                         ITradeManager tradeManager,
                         IFriendsManager friendsManager,
                         IDuelManager duelManager,
                         IBankManager bankManager,
                         IQuestsManager questsManager,
                         IUntouchableManager untouchableManager,
                         IWarehouseManager warehouseManager,
                         IShopManager shopManager,
                         ISkillCastingManager skillCastingManager,
                         ICastProtectionManager castProtectionManager,
                         IGamePacketFactory packetFactory,
                         UserManager <DbUser> userManager)
 {
     _logger                = logger;
     _database              = database;
     _characterLogger       = characterLogger;
     _gameWorld             = gameWorld;
     _databasePreloader     = databasePreloader;
     _definitionsPreloder   = definitionsPreloder;
     _countryProvider       = countryProvider;
     _speedManager          = speedManager;
     _statsManager          = statsManager;
     _healthManager         = healthManager;
     _levelProvider         = levelProvider;
     _levelingManager       = levelingManager;
     _inventoryManager      = inventoryManager;
     _linkingManager        = linkingManager;
     _guildManager          = guildManager;
     _gameSession           = gameSession;
     _stealthManager        = stealthManager;
     _attackManager         = attackManager;
     _skillsManager         = skillsManager;
     _buffsManager          = buffsManager;
     _elementProvider       = elementProvider;
     _killsManager          = killsManager;
     _vehicleManager        = vehicleManager;
     _shapeManager          = shapeManager;
     _movementManager       = movementManager;
     _additionalInfoManager = additionalInfoManager;
     _mapProvider           = mapProvider;
     _teleportationManager  = teleportationManager;
     _partyManager          = partyManager;
     _tradeManager          = tradeManager;
     _friendsManager        = friendsManager;
     _duelManager           = duelManager;
     _bankManager           = bankManager;
     _questsManager         = questsManager;
     _untouchableManager    = untouchableManager;
     _warehouseManager      = warehouseManager;
     _shopManager           = shopManager;
     _skillCastingManager   = skillCastingManager;
     _castProtectionManager = castProtectionManager;
     _packetFactory         = packetFactory;
     _userManager           = userManager;
 }