Exemple #1
0
        private async Task AddNewSystem(SystemPosition ps)
        {
            StarSystem ss = new StarSystem();

            ss.Name = ps.Name;
            var sys = await _starSystemRepository.Insert(ss);

            LogText(string.Format("{0}: Adding system: {1}", DateTime.Now, ps.Name));
            var current = _systemPointer.Get <string>("currentObjectId");;

            _systemPointer["lastObjectId"]    = current;
            _systemPointer["currentObjectId"] = sys.ObjectId;
            _systemPointer = await _systemPointerRepository.Save(_systemPointer);
        }
Exemple #2
0
        public async Task <StarSystem> AddNewStarSystem(SystemPosition ps)
        {
            if (null == CurrentExpedition)
            {
                throw new Exception("CurrentExpedition is null");
            }
            if (null == ps)
            {
                throw new ArgumentNullException("ps");
            }
            var ss = new StarSystem();

            ss.Name       = ps.Name;
            ss.Expedition = CurrentExpedition;
            var sys = await _starSystemRepository.Insert(ss);

            if (null != sys)
            {
                StarSystems.ToList().Add(sys);
            }
            return(sys);
        }