-
Notifications
You must be signed in to change notification settings - Fork 0
/
Board.cs
764 lines (668 loc) · 23.5 KB
/
Board.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
public class Board : MonoBehaviour
{
#region Fields / Properties
[SerializeField] GameObject tilePrefab;
public Dictionary<Point, Tile> tiles = new Dictionary<Point, Tile>();
public Point min { get { return _min; }}
public Point max { get { return _max; }}
Point _min;
Point _max;
Point[] dirs = new Point[4]
{
new Point(0, 1),
new Point(0, -1),
new Point(1, 0),
new Point(-1, 0)
};
Color selectedTileColor = new Color(0, 1, 1, 1);
Color defaultTileColor = new Color(1, 1, 1, 1);
Color highlightTileColor = new Color(0, 1, 1, 1);
Color exitMapTileColor = new Color(1, 1, 0, 1);
[SerializeField]
GameObject groundCrystalPrefab;
private Dictionary<Tile, GameObject> groundObjectDict = new Dictionary<Tile, GameObject>(); //key is maptileindex, value is the type of object it is
//int proximityValue = 5;
Transform tileHolder;//holds tiles
public bool isGridworldBoardSet = false; //so gridworld agent stuff doesn't start until board is ready
#endregion
#region Public
public void Load (LevelData data)
{
tiles = new Dictionary<Point, Tile>();
_min = new Point(int.MaxValue, int.MaxValue);
_max = new Point(int.MinValue, int.MinValue);
tileHolder = new GameObject("TileHolder").transform; //holds tiles
tileHolder.SetParent(transform);
for (int i = 0; i < data.tiles.Count; ++i)
{
GameObject instance = Instantiate(tilePrefab) as GameObject;
//instance.transform.SetParent(transform); board as parent
instance.transform.SetParent(tileHolder); //tileHolder as parent
Tile t = instance.GetComponent<Tile>();
t.Load(data.tiles[i]);
tiles.Add(t.pos, t);
if (data.tileTypeList == null)
t.TileType = NameAll.TILE_TYPE_DEFAULT;
else
t.TileType = data.tileTypeList[i];
_min.x = Mathf.Min(_min.x, t.pos.x);
_min.y = Mathf.Min(_min.y, t.pos.y);
_max.x = Mathf.Max(_max.x, t.pos.x);
_max.y = Mathf.Max(_max.y, t.pos.y);
}
}
public Tile GetTile(int x, int y)
{
Point p = new Point(x, y);
return tiles.ContainsKey(p) ? tiles[p] : null;
}
//called in CalculationProjectile to see if projectile is hindered crossing this tile
public Tile GetTileCollision(float x, float y, float z, Tile startTile, float unitHeight = 4.0f)
{
Tile tempTile = GetTile((int)Mathf.Round(x), (int)Mathf.Round(y));
if(tempTile != null && tempTile != startTile)
{
if (z <= tempTile.height)
return tempTile;
else if(tempTile.UnitId != NameAll.NULL_UNIT_ID && z <= tempTile.height + unitHeight)
{
return tempTile;
}
}
return null;
}
public Tile GetTile (Point p)
{
return tiles.ContainsKey(p) ? tiles[p] : null;
}
public Tile GetTile(Tile t)
{
return tiles.ContainsKey(t.pos) ? tiles[t.pos] : null;
}
public Tile GetTile(PlayerUnit target)
{
Point p = new Point();
p.x = target.TileX;
p.y = target.TileY;
return GetTile(p);
}
public List<Tile> Search(Tile start, Func<Tile, Tile, bool> addTile)
{
List<Tile> retValue = new List<Tile>();
retValue.Add(start);
ClearSearch();
Queue<Tile> checkNext = new Queue<Tile>();
Queue<Tile> checkNow = new Queue<Tile>();
start.distance = 0;
checkNow.Enqueue(start);
while (checkNow.Count > 0)
{
Tile t = checkNow.Dequeue();
for (int i = 0; i < 4; ++i)
{
Tile next = GetTile(t.pos + dirs[i]);
if (next == null || next.distance <= t.distance + 1)
continue;
if (addTile(t, next))
{
next.distance = t.distance + 1;
next.prev = t;
checkNext.Enqueue(next);
retValue.Add(next);
}
}
if (checkNow.Count == 0)
SwapReference(ref checkNow, ref checkNext);
}
return retValue;
}
//Combat uses search
//WalkAroundMode has multiple units so needs distanceDict and prevDict for each unitId
public List<Tile> SearchWalkAround(Tile start, int unitId, Func<Tile, Tile, bool> addTile)
{
List<Tile> retValue = new List<Tile>();
retValue.Add(start);
//Debug.Log("reaching here " + unitId);
ClearSearchWalkAround(unitId);
Queue<Tile> checkNext = new Queue<Tile>();
Queue<Tile> checkNow = new Queue<Tile>();
//start.distance = 0;
start.distanceDict[unitId] = 0;
checkNow.Enqueue(start);
while (checkNow.Count > 0)
{
Tile t = checkNow.Dequeue();
for (int i = 0; i < 4; ++i)
{
Tile next = GetTile(t.pos + dirs[i]);
//if (next == null || next.distance <= t.distance + 1)
// continue;
//continue if tile does not exist or if the tile has already been added to the distanceDict
if (next == null )
continue;
if (next.distanceDict.ContainsKey(unitId) && t.distanceDict.ContainsKey(unitId) && next.distanceDict[unitId] <= t.distanceDict[unitId] + 1)
continue;
if (addTile(t, next))
{
//next.distance = t.distance + 1;
//next.prev = t;
next.distanceDict[unitId] = t.distanceDict[unitId] + 1;
next.prevDict[unitId] = t;
checkNext.Enqueue(next);
retValue.Add(next);
}
}
if (checkNow.Count == 0)
SwapReference(ref checkNow, ref checkNext);
}
return retValue;
}
public void SelectTiles (List<Tile> tiles)
{
for (int i = tiles.Count - 1; i >= 0; --i)
{
//tiles[i].GetComponent<Renderer>().material.SetColor("_Color", selectedTileColor);
tiles[i].HighlightTile(0);
}
}
public void DeSelectTiles (List<Tile> tiles)
{
for (int i = tiles.Count - 1; i >= 0; --i)
{
//tiles[i].GetComponent<Renderer>().material.SetColor("_Color", defaultTileColor);
tiles[i].RevertTile();
}
}
public void UpdatePlayerUnitTile(PlayerUnit pu, Tile newTile)
{
Point p = new Point(pu.TileX, pu.TileY);
GetTile(p).UnitId = NameAll.NULL_UNIT_ID;
GetTile(newTile.pos).UnitId = pu.TurnOrder;
}
public void UpdatePlayerUnitTileSwap(PlayerUnit pu, Tile newTile)
{
//Point p = new Point(pu.TileX, pu.TileY); //this tile has already been updated with the actor who swapped in
//GetTile(p).UnitId = NameAll.NULL_UNIT_ID;
GetTile(newTile.pos).UnitId = pu.TurnOrder;
}
//called in combatState to highlight certain tiles
public void HighlightTile(Point p, int teamId, bool doHighlight)
{
Tile t = GetTile(p);
if (t != null)
{
if (doHighlight)
{
//t.GetComponent<Renderer>().material.SetColor("_Color", highlightTileColor);
//Debug.Log("highlighting tile");
t.HighlightTile(teamId);
}
else
{
//t.GetComponent<Renderer>().material.SetColor("_Color", defaultTileColor);
t.RevertTile();
}
}
}
public void UnhighlightTile(PlayerUnit pu)
{
Tile t = GetTile(pu);
if (t != null)
{
t.RevertTile();
}
}
//get reflect tile
public Tile GetReflectTile(PlayerUnit actor, PlayerUnit target)
{
int cast_x = actor.TileX;
int cast_y = actor.TileY;
int target_x = target.TileX;
int target_y = target.TileY;
int x1, y1;
if (cast_x <= target_x)
{
x1 = target_x + Math.Abs(target_x - cast_x);
}
else {
x1 = target_x - Math.Abs(target_x - cast_x);
}
if (cast_y <= target_y)
{
y1 = target_y + Math.Abs(target_y - cast_y);
}
else {
y1 = target_y - Math.Abs(target_y - cast_y);
}
Point p = new Point(x1, y1);
return GetTile(p);
}
//find the tile furtherst away from the nearest enemey
//in future can be used to find tile furthest away from all enemies
public Point GetFarthestPoint( List<Tile> moveOptions, Tile nearestFoe, Tile currentTile )
{
Point retValue = currentTile.pos;
int z1 = moveOptions.Count;
int zMax = 0;
for( int i = 0; i < z1; i++)
{
int z2 = Math.Abs(nearestFoe.pos.x - moveOptions[i].pos.x) + Math.Abs(nearestFoe.pos.y - moveOptions[i].pos.y);
if( z2 > zMax)
{
retValue = moveOptions[i].pos;
}
}
return retValue;
}
//get mimetargettile, called in CalcResolveAction
public Tile GetMimeTargetTile(PlayerUnit actor, PlayerUnit mime, Tile targetTile)
{
Tile actorTile = GetTile(actor);
Tile mimeTile = GetTile(mime);
//targeting self, retur the mime coordinates
if ( actorTile == targetTile)
{
return mimeTile;
}
int forwardOffset;
int sideOffset;
int xOffset = Mathf.Abs(targetTile.pos.x - actorTile.pos.x);
int yOffset = Mathf.Abs(targetTile.pos.y - actorTile.pos.y);
bool isRight; //is sideOffset to the right or left of the actor. if dead on, this doesn't matter (just adding 0)
int xMimeChange = 0; //added at the end to get the new point
int yMimeChange = 0; //added at the end to get the new point
//gets the direction the actor will be facing
Directions attackDir = actorTile.GetDirectionAttack(targetTile);
if ( attackDir == Directions.East )
{
//side offset is >= N/S offset, thus the forward offset is the xOffset
forwardOffset = xOffset;
sideOffset = yOffset;
if (targetTile.pos.y < actorTile.pos.y)
isRight = true;
else
isRight = false;
}
else if (attackDir == Directions.West)
{
//side offset is >= N/S offset, thus the forward offset is the xOffset
forwardOffset = xOffset;
sideOffset = yOffset;
if (targetTile.pos.y > actorTile.pos.y)
isRight = true;
else
isRight = false;
}
else if (attackDir == Directions.North)
{
//side offset is < N/S offset, thus the forward offset is the y offset
forwardOffset = yOffset;
sideOffset = xOffset;
if (targetTile.pos.x > actorTile.pos.x)
isRight = true;
else
isRight = false;
}
else //SOUTH
{
//side offset is < N/S offset, thus the forward offset is the y offset
forwardOffset = yOffset;
sideOffset = xOffset;
if (targetTile.pos.x < actorTile.pos.x)
isRight = true;
else
isRight = false;
}
if (mime.Dir == Directions.East)
{
xMimeChange = forwardOffset;
if (isRight)
yMimeChange = sideOffset * -1; //off to the right is DOWN the y axis
else
yMimeChange = sideOffset;
Debug.Log("E " + forwardOffset + " " + sideOffset);
}
else if (mime.Dir == Directions.West)
{
xMimeChange = forwardOffset * -1;
if (isRight)
yMimeChange = sideOffset; //off to the right is UP the y axis
else
yMimeChange = sideOffset * -1;
Debug.Log("W " + forwardOffset + " " + sideOffset);
}
else if (mime.Dir == Directions.North)
{
yMimeChange = forwardOffset;
if (isRight)
xMimeChange = sideOffset; //off to the right is UP the x axis
else
xMimeChange = sideOffset * -1;
Debug.Log("N " + forwardOffset + " " + sideOffset);
}
else //south
{
yMimeChange = forwardOffset * -1;
if (isRight)
xMimeChange = sideOffset * -1; //off to the right is DOWN the x axis
else
xMimeChange = sideOffset;
Debug.Log("S " + forwardOffset + " " + sideOffset);
}
Point p = new Point(mimeTile.pos.x + xMimeChange, mimeTile.pos.y + yMimeChange);
return GetTile(p); //can return null, null check done in CalcResolveAction
}
public void SetTilePickUp(int tileX, int tileY, bool isEnable, int pickUpId = 1)
{
Tile t = GetTile(tileX, tileY);
if(isEnable)
{
t.PickUpId = pickUpId;
}
else
{
t.PickUpId = 0;
}
if (pickUpId == 1)
{
SetPickUpObject(t, isEnable);
}
}
public void DisableUnit(PlayerUnit pu)
{
GetTile(pu).UnitId = NameAll.NULL_UNIT_ID;
}
void SetPickUpObject(Tile t, bool isEnable)
{
if(isEnable)
{
GameObject go = Instantiate(groundCrystalPrefab) as GameObject;
Vector3 vec = t.transform.position;
vec += new Vector3(0, (vec.y + 0.3f), 0);
go.transform.position = vec;
groundObjectDict.Add(t,go);
}
else
{
Destroy(groundObjectDict[t] );
groundObjectDict.Remove(t);
}
}
//move a tile pick up to a specific tile
void MoveTilePickUp(Tile t, GameObject go)
{
Vector3 vec = t.transform.position;
vec += new Vector3(0, (vec.y + 0.3f), 0);
go.transform.position = vec;
}
public void ResetCrystal()
{
int x = UnityEngine.Random.Range(0, this.max.x);
int y = UnityEngine.Random.Range(0, this.max.y);
while (this.IsCrystalOnTile(x, y))
{
x = UnityEngine.Random.Range(0, this.max.x);
y = UnityEngine.Random.Range(0, this.max.y);
}
this.MoveCrystal(x, y);
}
//called in Gridworld, moves first crystal found to the new position
//yes this is obviously a stupid way to do it
void MoveCrystal(int newX, int newY)
{
Tile t = this.GetTile(newX, newY);
List<Tile> tileKeys = new List<Tile>(groundObjectDict.Keys);
foreach (Tile tKey in tileKeys)
{
//if (tKey.pos.x == t.pos.x && tKey.pos.y == t.pos.y) //don't need to move starting on same spot
// break;
//get and move gameobject
GameObject go = groundObjectDict[tKey];
groundObjectDict[t] = go;
Vector3 vec = t.transform.position;
vec += new Vector3(0, (vec.y + 0.3f), 0);
go.transform.position = vec;
groundObjectDict.Remove(tKey);
break;
}
}
//called in CombatMoveSequenceState for WindsOfFate, returns a random tile that doesn't have a unit on it
public Point GetRandomPoint(Point p)
{
//Debug.Log("in get random point");
var tempList = RandomValues(this.tiles).ToList();
Tile t = tempList[0];
if (t.UnitId == NameAll.NULL_UNIT_ID)
{
return t.pos;
}
return p; //defaults to entered value unless new one is found
}
//called in WalkAroundMainState for WindsOfFate, returns a random tile that doesn't have a unit on it
public Tile GetRandomTile(Tile t)
{
//Debug.Log("in get random point");
var tempList = RandomValues(this.tiles).ToList();
Tile t_new = tempList[0];
if (t_new.UnitId == NameAll.NULL_UNIT_ID)
{
return t_new;
}
return t; //defaults to entered value unless new one is found
}
//grabs a random entry for a dictionary
public IEnumerable<TValue> RandomValues<TKey, TValue>(IDictionary<TKey, TValue> dict)
{
System.Random rand = new System.Random();
List<TValue> values = Enumerable.ToList(dict.Values);
int size = dict.Count;
yield return values[rand.Next(size)];
//while (true)
//{
// yield return values[rand.Next(size)];
//}
}
#endregion
#region Private
void ClearSearch ()
{
foreach (Tile t in tiles.Values)
{
t.prev = null;
t.distance = int.MaxValue;
}
}
void ClearSearchWalkAround(int unitId)
{
foreach (Tile t in tiles.Values)
{
//t.prev = null;
//t.distance = int.MaxValue;
t.prevDict.Remove(unitId);
t.distanceDict.Remove(unitId);
}
}
void SwapReference (ref Queue<Tile> a, ref Queue<Tile> b)
{
Queue<Tile> temp = a;
a = b;
b = temp;
}
#endregion
//is unit on tile that allows you to move to different map, called in WA Mode
public bool IsMapMove(PlayerUnit pu)
{
if (GetTile(pu).TileType == NameAll.TILE_TYPE_EXIT_MAP)
return true;
return false;
}
//check if there is a crystal on the tile. used in gridworld for placing unit after placing crystal
public bool IsCrystalOnTile(Tile t)
{
if (groundObjectDict.ContainsKey(t))
return true;
return false;
}
//check if there is a crystal on the tile. used in gridworld for placing unit after placing crystal
public bool IsCrystalOnTile(Point p)
{
Tile t = this.GetTile(p);
if (groundObjectDict.ContainsKey(t))
return true;
return false;
}
//check if there is a crystal on the tile. used in gridworld for placing unit after placing crystal
public bool IsCrystalOnTile(int x, int y)
{
Tile t = this.GetTile(x, y);
if (groundObjectDict.ContainsKey(t))
return true;
return false;
}
//find gridworld tile that has the goal and convert it to index of that tile
//0,0 is 0; move up x-axis increases index by 1, moving up y axis increases index by 4
public int GetGridworldGoal()
{
int retValue = NameAll.NULL_INT;
foreach (var entry in groundObjectDict)
{
//in gridworld should only be one object in this
retValue = entry.Key.pos.x + entry.Key.pos.y * (this.max.x + 1);
return retValue;
}
return retValue;
}
//move gridworld tile to new location and return index of that new tile location
//assume player is on this tile, so moving to any other random tile
public int ResetGridworldGoal()
{
while (true)
{
int x = UnityEngine.Random.Range(0, this.max.x+1);
int y = UnityEngine.Random.Range(0, this.max.y+1);
Tile t = this.GetTile(x, y);
if(groundObjectDict.ContainsKey(t))
{
//continue loop
}
else
{
this.MoveGridworldGoal(t);
return t.pos.x + t.pos.y * (this.max.x + 1);
}
}
}
//move gridworld goal by updating groundObjectDict and moving the GameObject
//only item in groundObjectDict should be the crystal
//updating the tile in the dictionary it is stored at
void MoveGridworldGoal(Tile t)
{
GameObject go;
foreach (var entry in groundObjectDict)
{
//in gridworld should only be one object in this
go = entry.Value;
groundObjectDict.Remove(entry.Key);
groundObjectDict[t] = go;
MoveTilePickUp(t, go);
return;
}
}
#region Outputs for Reinforcement Learning (RL) Observations
//incomplete code that I don't think I ever implemented
//public Dictionary<string,int> GetRLBoardInfo()
// {
// Dictionary<string, int> retDict = new Dictionary<string, int>();
// retDict["x_min"] = this.min.x;
// retDict["x_max"] = this.max.x;
// retDict["y_min"] = this.min.y;
// retDict["y_max"] = this.max.y;
// retDict["pickup_crystal_id"] = NameAll.GROUND_CRYSTAL_ID;
// return retDict;
// }
//public void GetRLInfoTerrain()
//{
// Debug.Log("Terrain Dict not implemented");
//}
//returns panels in order of implementation, use GetBoardInfo min/max x and y to reconstruct the board
//public Dictionary<Point, int> GetRLInfoBoardHeight()
//{
// Dictionary<Point, int> retDict = new Dictionary<Point, int>();
// foreach (var entry in tiles)
// {
// retDict.Add(entry.Key, entry.Value.height);
// }
// return retDict;
//}
//things on board that can change
//for now just crystals, PlayerUnits done through theirs tring
//in future can do things like terrain changes, standable changes, traversable changes etc
//public Dictionary<Point,int> GetRLInfoBoardStep()
//{
// Dictionary<Point, int> retDict = new Dictionary<Point, int>();
// foreach(var entry in groundObjectDict)
// {
// retDict[new Point(entry.Key.pos.x, entry.Key.pos.y)] = NameAll.GROUND_CRYSTAL_ID;
// }
// return retDict;
//}
#endregion
//DEPRECATED functions for checkign for CombatStart in WalkAround mode, now done through PUO and PlayerManager
//checks if units that are hostile to each other are in proximity to each other thus triggering combat
//if true sends notification to WalkAroundMainSTate
//uses SearchWalkAround and a dummy id (unitId + 1000) to get list of tiles within proximity range
//uses that list of tiles to see if combat check
// public void WalkAroundCheckProximityCombatTrigger(Tile t, int unitId)
// {
// SetCombatProximityValue();
// Dictionary<int, int> teamIdDict = new Dictionary<int, int>();
// var tileList = SearchWalkAround(t, unitId + 1000, ExpandSearchBase);
//Debug.Log("WalkAroundCheckProximityCombatTrigger 0... " + tileList.Count);
//foreach (Tile ti in tileList)
// {
// Debug.Log("WalkAroundCheckProximityCombatTrigger 1..." + ti.GetTileSummary());
// if (ti.UnitId != NameAll.NULL_UNIT_ID && ti.UnitId != unitId)
// {
// Debug.Log("WalkAroundCheckProximityCombatTrigger 2..." + ti.UnitId + " " + unitId );
// teamIdDict[PlayerManager.Instance.GetPlayerUnit(ti.UnitId).TeamId] = 1;
// if (IsTeamIdHostile(teamIdDict))
// {
// Debug.Log("WalkAroundCheckProximityCombatTrigger 3...");
// SendCombatTrigger();
// break;
// }
// }
// }
// }
//called in WalkAroundCheckProximityCombatTrigger as an argument for SearchWalkAround
//
// protected bool ExpandSearchBase(Tile from, Tile to)
// {
//return (from.distance + 1) <= 3; //this.proximityValue;
// }
//used to check if hostile units are too close to each other. for now just a constant, in future make it unit/context dependent
//is Set instead of Get due to how ExpandSearchBase is called
//void SetCombatProximityValue()
//{
// this.proximityValue = 1;
//}
////used to check if units that are close to each other are in fact hostile
////for now simply if on different teams then they are hostile
//bool IsTeamIdHostile(Dictionary<int,int> teamIdDict)
//{
// if (teamIdDict.Count() >= 1)
// return true;
// return false;
//}
//const string CombatStart = "PlayerManager.CombatStart";
// void SendCombatTrigger()
// {
//Debug.Log("sending combatTrigger from board");
// this.PostNotification(CombatStart, null);
// }
}