示例#1
0
 /// <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);
     }
 }
示例#2
0
 /// <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
     });
 }