Exemple #1
0
 public ShipInformationList()
 {
     Ships            = new Dictionary <int, ShipInformation>();
     StoredModules    = new ModulesInStore();
     itemlocalisation = new Dictionary <string, string>();
     currentid        = -1;
 }
Exemple #2
0
        public ModulesInStore StoreModule(string item, string itemlocalised)
        {
            ModulesInStore mis = this.ShallowClone();

            mis.StoredModules.Add(new JournalLoadout.ShipModule("", "", item, "", itemlocalised));
            return(mis);
        }
Exemple #3
0
        public ModulesInStore StoreModule(ModuleItem[] items, Dictionary <string, string> itemlocalisation)
        {
            ModulesInStore mis = this.ShallowClone();

            foreach (ModuleItem it in items)
            {
                string local = itemlocalisation.ContainsKey(it.Name) ? itemlocalisation[it.Name] : "";
                mis.StoredModules.Add(new JournalLoadout.ShipModule("", "", it.Name, "", local));
            }
            return(mis);
        }
Exemple #4
0
        public ModulesInStore RemoveModule(string item)
        {
            int index = StoredModules.FindIndex(x => x.Item.Equals(item, StringComparison.InvariantCultureIgnoreCase));  // if we have an item of this name

            if (index != -1)
            {
                ModulesInStore mis = this.ShallowClone();
                mis.StoredModules.RemoveAt(index);
                return(mis);
            }
            else
            {
                return(this);
            }
        }
Exemple #5
0
        public ModulesInStore ShallowClone()          // shallow clone.. does not clone the ship modules, just the dictionary
        {
            ModulesInStore mis = new ModulesInStore(this.StoredModules);

            return(mis);
        }