Ejemplo n.º 1
0
        public bool SyncWithMap()
        {
            this.Message("SquadManager.SyncWithMap()");
            SquadManagerThing squadManagerThing = SquadManagerThing.Instance;

            if (SquadManagerThing.Instance.InMap)
            {
                this.squads.Clear();
                this.squads.AddRange(squadManagerThing.Squads);
                this.favorites.Clear();
                this.favorites.AddRange(squadManagerThing.Favorites);
                foreach (Squad current in this.squads)
                {
                    AllColonistsSquad allColonistsSquad = current as AllColonistsSquad;
                    if (allColonistsSquad != null)
                    {
                        this.allColonistsSquad = allColonistsSquad;
                    }
                }
                if (this.allColonistsSquad == null)
                {
                    Log.Error("Could not find default all-colonists squad");
                }
                else
                {
                    ColonistTracker.Instance.StartTrackingPawns(this.AllColonistsSquad.Pawns);
                }
                this.CurrentSquad = squadManagerThing.CurrentSquad;
                this.SquadFilter  = squadManagerThing.SquadFilter;
                return(true);
            }
            return(false);
        }
 public ComponentSquadManager()
 {
     SquadManager.Instance.Reset();
     SquadManagerThing.Clear();
     this.preferences.Add(this.preferenceEnableSquads);
     this.preferences.Add(this.preferenceEnableSquadFiltering);
     this.preferences.Add(this.preferenceEnableSquadRow);
     this.preferences.Add(this.preferenceAlwaysShowSquadName);
 }
 public static void Clear()
 {
     SquadManagerThing.instance = null;
 }