Exemplo n.º 1
0
        protected override void Load()
        {
            Feast.instance    = this;
            this.locations    = new List <Locs>();
            this.maplocations = new List <Locs>();
            if (LevelNodes.Nodes == null)
            {
                LevelNodes.load();
            }
            foreach (Node n in LevelNodes.Nodes)
            {
                Locs loc = new Locs(n.Position, ((NodeLocation)n).Name);
                maplocations.Add(loc);
            }
            List <string> usedlocs = new List <string>();

            if (this.Configuration.Items == null || !this.Configuration.Items.Any())
            {
                Logger.Log("Failed to load the configuration file.  Turned off feast.  Restart to try again.");
                return;
            }
            ;
            List <FeastItem> items = new List <FeastItem>();

            foreach (FeastItem f in this.Configuration.Items)
            {
                usedlocs = usedlocs.Concat(f.Location).ToList();
                ItemAsset itemAsset = (ItemAsset)Assets.find(EAssetType.Item, f.Id);
                if (itemAsset != null && !itemAsset.Cosmetic)
                {
                    items.Add(f);
                }
            }
            this.items = items;
            List <string> locations = usedlocs.Distinct().ToList();

            if (locations.Contains("all") || locations.Contains("All"))
            {
                this.locations = maplocations;
            }
            else
            {
                foreach (Locs a in maplocations)
                {
                    if (locations.IndexOf(a.Name()) != -1)
                    {
                        this.locations.Add(a);
                    }
                }
            }
            this.running = true;
            this.resetFeast();
        }
Exemplo n.º 2
0
 public void setNextLocation(Locs loc)
 {
     nextLocation = loc;
 }