/// <summary> /// Maps a door component from the database to the game system. /// </summary> /// <param name="component"></param> /// <returns></returns> private DomainClasses.SceneDoor loadDoorComponent(DTO.SceneComponent component) { DTO.SceneDoor door = connection.Table <DTO.SceneDoor>().Where(x => x.identifier == component.identifier).FirstOrDefault(); DTO.SceneComponent exitComponent = connection.Table <DTO.SceneComponent>().Where(x => x.identifier == door.exitID).FirstOrDefault(); return(new DomainClasses.SceneDoor(component, door, loadExitComponent(exitComponent))); }
/// <summary> /// Maps an exit component from the database to the game system. /// </summary> /// <param name="component"></param> /// <returns></returns> private DomainClasses.SceneExit loadExitComponent(DTO.SceneComponent component) { DTO.SceneExit exit = connection.Table <DTO.SceneExit>().Where(x => x.identifier == component.identifier).FirstOrDefault(); return(new DomainClasses.SceneExit(component, exit)); }