Exemplo n.º 1
0
        private ComponentAdjacencyBonus[] ResolveLocationAdjacencies(ShipComponent component)
        {
            Facing facing = grid.GetZone(component);
            List <ComponentAdjacencyBonus> adjacencyBonuses = new List <ComponentAdjacencyBonus>();

            foreach (ComponentAdjacencyBonus bonus in component.Type.adjacencyBonuses)
            {
                if (bonus.propertyIdentifier.EndsWith(zoneBasedStringMarker))
                {
                    adjacencyBonuses.Add(new ComponentAdjacencyBonus(
                                             bonus.componentIdentifier,
                                             bonus.propertyIdentifier.Replace(zoneBasedStringMarker, facing.GetPropertyString()),
                                             bonus.amount));
                }
                else
                {
                    adjacencyBonuses.Add(bonus);
                }
            }
            return(adjacencyBonuses.ToArray());
        }
Exemplo n.º 2
0
        private List <ComponentProperty> ResolveLocations(Facing f, ComponentProperty[] components)
        {
            List <ComponentProperty> properties = new List <ComponentProperty>();

            foreach (ComponentProperty bonus in components)
            {
                if (bonus.propertyIdentifier.EndsWith(zoneBasedStringMarker))
                {
                    properties.Add(new ComponentProperty(
                                       bonus.propertyIdentifier.Replace(zoneBasedStringMarker, f.GetPropertyString()),
                                       bonus.amount));
                }
                else
                {
                    properties.Add(bonus);
                }
            }
            return(properties.ToList());
        }