/// <summary> /// Removes a scene component from a scene's inventory in the database. /// </summary> /// <param name="gameID"></param> /// <param name="scene"></param> /// <param name="item"></param> public void removeSceneComponent(int gameID, DomainClasses.Scene scene, DomainClasses.SceneComponent item) { DTO.SceneInventory itemToRemove = connection.Table <DTO.SceneInventory>().Where(x => x.gameID == gameID && x.sceneID == scene.identifier && x.componentID == item.identifier).ToArray().FirstOrDefault(); if (itemToRemove != null) { connection.Delete <SceneInventory>(itemToRemove.identifier); } }
/// <summary> /// Adds a scene component to a scene's inventory in the database. /// </summary> /// <param name="gameID"></param> /// <param name="scene"></param> /// <param name="item"></param> public void addSceneComponent(int gameID, DomainClasses.Scene scene, DomainClasses.SceneComponent item) { connection.Insert(new DTO.SceneInventory { gameID = gameID, sceneID = scene.identifier, componentID = item.identifier }); }