OSDN Git Service

re-load partial map metadata
[automap/automap.git] / Automap / Data / Designator.cs
1 using System;
2 using System.Collections.Generic;
3 using System.Collections.ObjectModel;
4 using System.Drawing;
5
6 using Vintagestory.API.Client;
7 using Vintagestory.API.Common;
8 using Vintagestory.API.MathTools;
9
10 namespace Automap
11 {
12         public delegate void DesignatonAction(ICoreClientAPI clientAPI, PointsOfInterest poi, BlockPos posn, Block block);
13
14         /// <summary>
15         /// Point of Interest Rule Designator
16         /// </summary>
17         public class Designator
18         {               
19                 public Color OverwriteColor;
20                 public DesignatonAction SpecialAction;
21                 public AssetLocation Pattern;
22                 public EnumBlockMaterial? Material;
23
24                 private Designator( )
25                 {
26                 throw new NotSupportedException( );
27                 }
28
29                 public Designator( AssetLocation pattern , Color overwriteColor, EnumBlockMaterial? material)
30                 {                       
31                         this.Pattern = pattern;
32                         this.OverwriteColor = overwriteColor;
33                         Material = material;
34                 }
35
36                 public Designator(AssetLocation pattern, Color overwriteColor, EnumBlockMaterial? material ,DesignatonAction specialAct )
37                 {
38                 this.Pattern = pattern;
39                 this.OverwriteColor = overwriteColor;
40                 this.Material = material;
41                 this.SpecialAction = specialAct;
42                 }
43
44                 public override string ToString( )
45                 {
46                         return Pattern.ToShortString() +"|"+ OverwriteColor.Name + "|" + Material ?? "";
47                 }
48         }
49 }
50