// Copyright (c) Strange Loop Games. All rights reserved.
// See LICENSE file in the project root for full license information.

namespace Eco.Mods.TechTree
{
    using System;
    using System.Linq;
    using Eco.Gameplay.Items;
    using Eco.Gameplay.Objects;
    using Eco.Gameplay.Players;
    using Eco.Gameplay.Systems;
    using Eco.Gameplay.Systems.TextLinks;
    using Eco.Gameplay.Systems.Tooltip;
    using Eco.Gameplay.Systems.NewTooltip;
    using Eco.Gameplay.Systems.NewTooltip.TooltipLibraryFiles;
    using Eco.Shared.Items;
    using Eco.Shared.Localization;
    using Eco.Gameplay.Property;
    using Eco.Shared.Networking;
    using Eco.Shared.Math;
    using Eco.Shared.Utils;
    using Eco.Shared.Serialization;
    using System.ComponentModel;
    using Eco.Core.Controller;
    using Eco.Core.Utils;
    using Eco.Gameplay.Utils;
    using Eco.Gameplay.Components;
    using Eco.Gameplay.GameActions;
    using Eco.Shared.Voxel;
    using Eco.Gameplay.Settlements;
    using Eco.Gameplay.Civics;

    [RelatedFeature(nameof(FeatureConfig.SettlementSystemEnabled))] public partial class TownFoundationItem : SettlementFoundationItem<TownFoundationObject> 
    { protected override SettlementType SettlementType => new SettlementType(0); }
    [RelatedFeature(nameof(FeatureConfig.SettlementSystemEnabled))] public partial class CountryFoundationItem : SettlementFoundationItem<CountryFoundationObject>
    { protected override SettlementType SettlementType => new SettlementType(1); }
    [RelatedFeature(nameof(FeatureConfig.SettlementSystemEnabled))] public partial class FederationFoundationItem : SettlementFoundationItem<FederationFoundationObject>
    { protected override SettlementType SettlementType => new SettlementType(2); }

    [RequireComponent(typeof(CitizenRosterComponent))]
    [RequireComponent(typeof(RoomRequirementsComponent))]
    [RelatedFeature(nameof(FeatureConfig.SettlementSystemEnabled))]
    [HasCivicAction(typeof(CivicAction_JoinSettlement))]
    [HasCivicAction(typeof(CivicAction_SecedeFromParentSettlement))]
    [HasCivicAction(typeof(CivicAction_DenaturalizeCitizens))]
    public partial class TownFoundationObject : SettlementFoundationObject
    {
        public override SettlementType SettlementType => new SettlementType(0);
    }

    [RequireComponent(typeof(SettlementRosterComponent))]
    [RequireComponent(typeof(RoomRequirementsComponent))]
    [RequireComponent(typeof(ConstitutionComponent))]
    [RelatedFeature(nameof(FeatureConfig.SettlementSystemEnabled))]
    [HasCivicAction(typeof(CivicAction_JoinSettlement))]
    [HasCivicAction(typeof(CivicAction_AddChildSettlement))]
    [HasCivicAction(typeof(CivicAction_CedeChildSettlement))]
    [HasCivicAction(typeof(CivicAction_SecedeFromParentSettlement))]
    public partial class CountryFoundationObject : SettlementFoundationObject, ICivicObject
    {
        public override SettlementType SettlementType => new SettlementType(1);
    }

    [RequireComponent(typeof(SettlementRosterComponent))]
    [RequireComponent(typeof(RoomRequirementsComponent))]
    [RequireComponent(typeof(ConstitutionComponent))]
    [RelatedFeature(nameof(FeatureConfig.SettlementSystemEnabled))]
    [HasCivicAction(typeof(CivicAction_AddChildSettlement))]
    [HasCivicAction(typeof(CivicAction_CedeChildSettlement))]
    public partial class FederationFoundationObject : SettlementFoundationObject
    {
        public override SettlementType SettlementType => new SettlementType(2);
    }

}
