Beispiel #1
0
 public void ClickableCheck(Object obj)
 {
     if (obj is IClickable)
     {
         var active = Vector.IsInRange(Position, obj.Position, obj.Range);
         //TODO: fix
         //Packet.Builder.MapAssetActionAvailableCommand(World.StorageManager.GetGameSession(Id), obj, active);
     }
 }
Beispiel #2
0
        public bool RemoveObject(Object obj)
        {
            var collectable = obj as Collectable;

            if (collectable != null)
            {
                Collectables.Remove(collectable.Hash);
            }
            return(Objects.TryRemove(obj.Id, out obj));
        }
Beispiel #3
0
        public bool AddObject(Object obj)
        {
            var collectable = obj as Collectable;

            if (collectable != null)
            {
                Collectables.Add(collectable.Hash, collectable);
            }
            return(Objects.TryAdd(obj.Id, obj));
        }
Beispiel #4
0
 public void UnloadObject(Object obj)
 {
     if (obj is Collectable)
     {
         Storage.UnLoadCollectable(obj as Collectable);
     }
     if (obj is Asset)
     {
         Storage.UnloadAsset(obj as Asset);
     }
     else
     {
         if (Storage.LoadedObjects.ContainsKey(obj.Id))
         {
             Storage.LoadedObjects.Remove(obj.Id);
         }
     }
 }
Beispiel #5
0
        public void LoadObject(Object obj)
        {
            if (obj == null)
            {
                return;
            }

            if (obj is Station)
            {
                Storage.LoadStation(obj as Station);
            }
            else if (obj is Jumpgate)
            {
                Storage.LoadPortal(obj as Jumpgate);
            }
            else if (obj is Asteroid)
            {
                Storage.LoadAsteroid(obj as Asteroid);
            }
            else if (obj is Asset)
            {
                Storage.LoadAsset(obj as Asset);
            }
            else if (obj is Collectable)
            {
                Storage.LoadCollectable(obj as Collectable);
            }
            else if (obj is Ore)
            {
                Storage.LoadResource(obj as Ore);
            }
            else if (obj is Billboard)
            {
                Storage.LoadBillboard(obj as Billboard);
            }
            else if (obj is Mine)
            {
                Storage.LoadMine(obj as Mine);
            }
        }
Beispiel #6
0
 public bool RemoveObject(Object obj)
 {
     obj.Position = null;
     return(Objects.TryRemove(obj.Id, out obj));
 }
Beispiel #7
0
 public bool AddObject(Object obj)
 {
     return(Objects.TryAdd(obj.Id, obj));
 }