コード例 #1
0
 public RenderLayerDefinition(TerrainMatchType matchType,
                              string tag,
                              string matchAs,
                              IReadOnlyList <string> matchWith)
 {
     Tag       = tag;
     MatchType = matchType;
     MatchAs   = matchAs;
     MatchWith = matchWith ?? throw new ArgumentNullException(nameof(matchWith));
 }
コード例 #2
0
        public TerrainGraphic WithMatchRule(int layer,
                                            TerrainMatchType matchType,
                                            string tag,
                                            string self = null,
                                            params string[] with)
        {
            if (layer < 0)
            {
                throw new ArgumentException();
            }

            MatchRule = new Dictionary <int, RenderLayerDefinition>((IDictionary <int, RenderLayerDefinition>)MatchRule)
            {
                [layer] = new RenderLayerDefinition(matchType, tag, self, new List <string>(with))
            };
            return(this);
        }
コード例 #3
0
        internal static bool IsMatch(this TerrainTile tile, TerrainMatchType match)
        {
            switch (match)
            {
            case TerrainMatchType.Land:
                if (tile.IsLandTile())
                {
                    return(true);
                }
                break;

            case TerrainMatchType.Sea:
                if (tile.IsSeaTile())
                {
                    return(true);
                }
                break;
            }

            return(false);
        }