Example #1
0
    /// <summary>
    /// Sets the global position of this building based on the position of the settlement
    /// in the world, as well as this buildings location within the settlement
    /// </summary>
    /// <param name="settlementBaseCoord">The base tile of the settlement in global coords</param>
    /// <param name="buildingSettlementCoord">The coordinate of this building in the settlement</param>
    public void SetPositions(Vec2i settlementBaseCoord, Vec2i buildingSettlementCoord)
    {
        WorldPosition = settlementBaseCoord + buildingSettlementCoord;
        Entrance      = WorldPosition;
        if (BuildingSubworld != null)
        {
            BuildingSubworld.Entrance = ExternalEntranceObject;
            BuildingSubworld.Exit     = InternalEntranceObject;
            BuildingSubworld.SetExternalEntrancePos(WorldPosition + BuildingSubworld.ExternalEntrancePos);


            ExternalEntranceObject.SetSubworld(BuildingSubworld);
            InternalEntranceObject.SetSubworld(BuildingSubworld);
        }
    }