OSDN Git Service

indentation
[automap/automap.git] / Automap / Data / BlockDesignator.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 BlockDesignatonAction(ICoreClientAPI clientAPI, PointsOfInterest poi, BlockPos posn, Block block);
13
14         /// <summary>
15         /// Point of Interest Rule Designator
16         /// </summary>
17         public class BlockDesignator
18         {
19                 public Color OverwriteColor;
20                 public BlockDesignatonAction SpecialAction;
21                 public AssetLocation Pattern;
22                 public EnumBlockMaterial? Material;
23                 public bool Enabled { get; set; }
24
25                 private BlockDesignator()
26                 {
27                         throw new NotSupportedException();
28                 }
29
30                 public BlockDesignator(AssetLocation pattern, Color overwriteColor, EnumBlockMaterial? material)
31                 {
32                         this.Pattern = pattern;
33                         this.OverwriteColor = overwriteColor;
34                         this.Material = material;
35                         this.Enabled = true;
36                 }
37
38                 public BlockDesignator(AssetLocation pattern, Color overwriteColor, EnumBlockMaterial? material, BlockDesignatonAction specialAct)
39                 {
40                         this.Pattern = pattern;
41                         this.OverwriteColor = overwriteColor;
42                         this.Material = material;
43                         this.SpecialAction = specialAct;
44                         this.Enabled = true;
45                 }
46
47                 public override string ToString()
48                 {
49                         return Pattern.ToShortString() + "|" + OverwriteColor.Name + "|" + Material ?? "";
50                 }
51         }
52 }
53