Example #1
0
        public void MapWhenStationOperatorNotSet()
        {
            var station = TestStations.Vauxhall;
            StationStructure vauxhall = Timetable.Web.Test.Knowledgebase.TestStations.Stations.Station[1];
            var mapper = new StationMapper(_tocs);

            mapper.Update(station, vauxhall);
            Assert.Equal(Toc.Unknown, station.StationOperator);
        }
Example #2
0
    public void CopyData(StationStructure other)
    {
        this.Name = other.Name;
        this.cost = other.cost;
        this.buildPointCost = other.buildPointCost;
        this.Icon = other.Icon;
        this.buildWindowPosition = other.buildWindowPosition;
        this.structureModifiers = other.structureModifiers;
        this.ID = other.ID;

        this.maxPopulationIncrease = other.maxPopulationIncrease;
    }
Example #3
0
        internal void Update(Station station, StationStructure kbStation)
        {
            station.Name        = kbStation.Name;
            station.Nlc         = kbStation.AlternativeIdentifiers?.NationalLocationCode;
            station.Coordinates = new Coordinates()
            {
                Longitude = kbStation.Longitude,
                Latitude  = kbStation.Latitude
            };
            var stationOperator = string.IsNullOrEmpty(kbStation.StationOperator) ?
                                  Toc.Unknown :
                                  _tocLookup.FindOrAdd(kbStation.StationOperator);

            station.StationOperator = stationOperator;
        }
Example #4
0
    void Start()
    {
        //assemble station structure dictionary
        StructureList structureList = GameObject.Find("_Lists").GetComponent<StructureList>();
        List<StationStructure> upgrades = structureList.GetAllStationUpgrades();
        for (int i = 0; i < upgrades.Count; i++)
        {
            StationStructure newStructure = new StationStructure();
            newStructure.CopyData(upgrades[i]);
            stationStructures.Add(newStructure.ID, newStructure);
        }

        _money = 1000;

        StartNewTurn();
    }
 private void Awake()
 {
     instance    = this;
     Spaces      = new Dictionary <Vector2Int, bool>();
     Foundations = new Dictionary <Vector2Int, bool>();
 }
Example #6
0
 void Start()
 {
     IsSelected = false;
     IncomeRate = 0;
     researchRate = 0;
     StationStructure housing = new StationStructure();
     housing.Housing();
     structures.Add(1, housing);
 }
Example #7
0
 void ApplyUpgrade(StationStructure upgrade)
 {
     builtStructures.Add(upgrade.ID);
     upgrade.ApplyUpgrade(this);
 }
Example #8
0
    //returns true if upgrade was bought
    public bool BuyUpgrade(StationStructure upgrade)
    {
        if (!upgrade.isBuilt && buy(upgrade.cost))
        {
            StationStructure newUpgrade = new StationStructure();
            newUpgrade.CopyData(upgrade);

            buildQueue.Add(newUpgrade);

            return true;
        }

        return false;
    }