Example #1
0
 public Tech(string name, Cost cost, TechRequirements techRequirements, int ranking, TechCategory category)
 {
     this.name             = name;
     this.cost             = cost;
     this.techRequirements = techRequirements;
     this.ranking          = ranking;
     this.category         = category;
 }
Example #2
0
    /**
     * Return True if the player can have this tech, False otherwise
     */
    public bool hasTech(Tech tech)
    {
        return(true);

        // check the PRT
        TechRequirements req = tech.getTechRequirements();

        if (req.getPrtRequired() != race.getPRT())
        {
            return(false);
        }
        if (race.getPRT() == req.getPrtDenied())
        {
            return(false);
        }

        foreach (LRT lrt in req.getLrtsRequired())
        {
            if (!race.getLrts().Contains(lrt))
            {
                return(false);
            }
        }

        foreach (LRT lrt in req.getLrtsDenied())
        {
            if (race.getLrts().Contains(lrt))
            {
                return(false);
            }
        }

        if (techLevels.lt(req))
        {
            return(false);
        }

        return(true);
    }
Example #3
0
 public TechHull(string name, Cost cost, TechRequirements techRequirements, int ranking, TechCategory category) : base(name, cost, techRequirements, ranking, category)
 {
 }
Example #4
0
 public bool IsAvailable(Settlement.Settlement settlement)
 {
     return((RankRequirement == null || settlement.Rank >= RankRequirement) &&
            (TechRequirements == null || TechRequirements.TrueForAll(tech => settlement.TechManager.Discovered.Contains(tech))));
 }
Example #5
0
 public void setTechRequirements(TechRequirements techRequirements)
 {
     this.techRequirements = techRequirements;
 }
Example #6
0
 public TechPlanetaryScanner(string name, Cost cost, TechRequirements techRequirements, int ranking, TechCategory category) : base(name, cost, techRequirements, ranking, category)
 {
 }