MostLikelyProducer() public method

public MostLikelyProducer ( ) : TraitPair
return TraitPair
        public PlaceBuildingOrderGenerator(ProductionQueue queue, string name)
        {
            var world = queue.Actor.World;
            this.queue = queue;
            placeBuildingInfo = queue.Actor.Owner.PlayerActor.Info.TraitInfo<PlaceBuildingInfo>();
            building = name;

            // Clear selection if using Left-Click Orders
            if (Game.Settings.Game.UseClassicMouseStyle)
                world.Selection.Clear();

            var map = world.Map;
            var tileset = world.Map.Tileset.ToLowerInvariant();

            var info = map.Rules.Actors[building];
            buildingInfo = info.TraitInfo<BuildingInfo>();

            var buildableInfo = info.TraitInfo<BuildableInfo>();
            var mostLikelyProducer = queue.MostLikelyProducer();
            faction = buildableInfo.ForceFaction
                ?? (mostLikelyProducer.Trait != null ? mostLikelyProducer.Trait.Faction : queue.Actor.Owner.Faction.InternalName);

            buildOk = map.Rules.Sequences.GetSequence("overlay", "build-valid-{0}".F(tileset)).GetSprite(0);
            buildBlocked = map.Rules.Sequences.GetSequence("overlay", "build-invalid").GetSprite(0);

            buildingInfluence = world.WorldActor.Trait<BuildingInfluence>();
        }
        public PlaceBuildingOrderGenerator(ProductionQueue queue, string name)
        {
            producer = queue.Actor;
            placeBuildingInfo = producer.Owner.PlayerActor.Info.Traits.Get<PlaceBuildingInfo>();
            building = name;

            // Clear selection if using Left-Click Orders
            if (Game.Settings.Game.UseClassicMouseStyle)
                producer.World.Selection.Clear();

            var map = producer.World.Map;
            var tileset = producer.World.TileSet.Id.ToLowerInvariant();

            var info = map.Rules.Actors[building];
            buildingInfo = info.Traits.Get<BuildingInfo>();

            var buildableInfo = info.Traits.Get<BuildableInfo>();
            race = buildableInfo.ForceRace ?? queue.MostLikelyProducer().Trait.Race;

            buildOk = map.SequenceProvider.GetSequence("overlay", "build-valid-{0}".F(tileset)).GetSprite(0);
            buildBlocked = map.SequenceProvider.GetSequence("overlay", "build-invalid").GetSprite(0);

            buildingInfluence = producer.World.WorldActor.Trait<BuildingInfluence>();
        }