OSDN Git Service

82b1e25973f3a55d696ec4b3e5417dcd773411de
[automap/automap.git] / Automap / Data / EntityDesignator.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.Common.Entities;
9 using Vintagestory.API.MathTools;
10
11 namespace Automap
12 {
13         public delegate void EntityDesignatonAction(ICoreClientAPI clientAPI, EntitiesOfInterest poi, BlockPos posn, Entity entity);
14
15         /// <summary>
16         /// Point of Interest Rule Designator
17         /// </summary>
18         public class EntityDesignator
19         {
20                 public Color OverwriteColor;
21                 public EntityDesignatonAction SpecialAction;
22                 public AssetLocation Pattern;
23                 public EnumEntityState? StateCheck;//Needed?
24                 public bool Enabled { get; set; }
25
26                 private EntityDesignator()
27                 {
28                         throw new NotSupportedException();
29                 }
30
31                 public EntityDesignator(AssetLocation pattern, Color overwriteColor, EnumEntityState? state)
32                 {
33                         this.Pattern = pattern;
34                         this.OverwriteColor = overwriteColor;
35                         this.StateCheck = state;
36                         this.Enabled = true;
37                 }
38
39                 public EntityDesignator(AssetLocation pattern, Color overwriteColor, EnumEntityState? state, EntityDesignatonAction specialAct)
40                 {
41                         this.Pattern = pattern;
42                         this.OverwriteColor = overwriteColor;
43                         this.StateCheck = state;
44                         this.SpecialAction = specialAct;
45                         this.Enabled = true;
46                 }
47
48                 public override string ToString()
49                 {
50                         return Pattern.ToShortString() + "|" + OverwriteColor.Name + "|" + StateCheck ?? "";
51                 }
52         }
53 }
54