Example #1
0
        public GameObject(Game game, float x, float y, int collisionRadius, int visionRadius = 0, uint netId = 0) : base(x, y)
        {
            _game             = game;
            _networkIdManager = game.NetworkIdManager;
            if (netId != 0)
            {
                NetId = netId; // Custom netId
            }
            else
            {
                NetId = _networkIdManager.GetNewNetId(); // Let the base class (this one) asign a netId
            }
            Target          = null;
            CollisionRadius = collisionRadius;
            VisionRadius    = visionRadius;
            Waypoints       = new List <Vector2>();

            _visibleByTeam = new Dictionary <TeamId, bool>();
            var teams = Enum.GetValues(typeof(TeamId)).Cast <TeamId>();

            foreach (var team in teams)
            {
                _visibleByTeam.Add(team, false);
            }

            Team             = TeamId.TEAM_NEUTRAL;
            _movementUpdated = false;
            _toRemove        = false;
        }
Example #2
0
 public HandleSpawn(Game game)
 {
     _logger           = LoggerProvider.GetLogger();
     _game             = game;
     _itemManager      = game.ItemManager;
     _playerManager    = game.PlayerManager;
     _networkIdManager = game.NetworkIdManager;
 }
Example #3
0
        public Spell(Game game, IChampion owner, string spellName, byte slot)
        {
            Owner             = owner;
            SpellName         = spellName;
            Slot              = slot;
            _game             = game;
            SpellData         = game.Config.ContentManager.GetSpellData(spellName);
            _scriptEngine     = game.ScriptEngine;
            _networkIdManager = game.NetworkIdManager;

            //Set the game script for the spell
            _spellGameScript = _scriptEngine.CreateObject <IGameScript>("Spells", spellName) ?? new GameScriptEmpty();
            //Activate spell - Notes: Deactivate is never called as spell removal hasn't been added
            _spellGameScript.OnActivate(owner);
        }
Example #4
0
 public PlayerManager(Game game)
 {
     _game             = game;
     _networkIdManager = game.NetworkIdManager;
 }
Example #5
0
 public HandleCastSpell(Game game)
 {
     _game             = game;
     _networkIdManager = game.NetworkIdManager;
     _playerManager    = game.PlayerManager;
 }