Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 101 additions & 19 deletions Dots-RTS-Development/Assets/Scenes/Debug.unity
Original file line number Diff line number Diff line change
Expand Up @@ -353,12 +353,12 @@ Prefab:
- target: {fileID: 224330000714602946, guid: d1ba9546a2394a84a8392d5719b29294,
type: 2}
propertyPath: m_AnchoredPosition.x
value: 996.8205
value: 996.6728
objectReference: {fileID: 0}
- target: {fileID: 224330000714602946, guid: d1ba9546a2394a84a8392d5719b29294,
type: 2}
propertyPath: m_AnchoredPosition.y
value: -81.01452
value: -80.99673
objectReference: {fileID: 0}
- target: {fileID: 224330000714602946, guid: d1ba9546a2394a84a8392d5719b29294,
type: 2}
Expand Down Expand Up @@ -621,12 +621,12 @@ Prefab:
- target: {fileID: 224330000714602946, guid: d1ba9546a2394a84a8392d5719b29294,
type: 2}
propertyPath: m_AnchoredPosition.x
value: 334.80585
value: 334.7636
objectReference: {fileID: 0}
- target: {fileID: 224330000714602946, guid: d1ba9546a2394a84a8392d5719b29294,
type: 2}
propertyPath: m_AnchoredPosition.y
value: -81.01452
value: -80.99673
objectReference: {fileID: 0}
- target: {fileID: 224330000714602946, guid: d1ba9546a2394a84a8392d5719b29294,
type: 2}
Expand Down Expand Up @@ -1673,6 +1673,47 @@ Prefab:
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: d1ba9546a2394a84a8392d5719b29294, type: 2}
m_IsPrefabParent: 0
--- !u!1 &281681152
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 281681154}
- component: {fileID: 281681153}
m_Layer: 0
m_Name: InterfaceTester (1)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &281681153
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 281681152}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3a609d74af62adc4498b9be5e7c202d3, type: 3}
m_Name:
m_EditorClassIdentifier:
identifier: Two
--- !u!4 &281681154
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 281681152}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 555.54016, y: 458.44223, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 14
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &293755674
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -2983,12 +3024,12 @@ Prefab:
- target: {fileID: 224330000714602946, guid: d1ba9546a2394a84a8392d5719b29294,
type: 2}
propertyPath: m_AnchoredPosition.x
value: 1261.6265
value: 1261.4365
objectReference: {fileID: 0}
- target: {fileID: 224330000714602946, guid: d1ba9546a2394a84a8392d5719b29294,
type: 2}
propertyPath: m_AnchoredPosition.y
value: -81.01452
value: -80.99673
objectReference: {fileID: 0}
- target: {fileID: 224330000714602946, guid: d1ba9546a2394a84a8392d5719b29294,
type: 2}
Expand Down Expand Up @@ -3674,12 +3715,12 @@ Prefab:
- target: {fileID: 224330000714602946, guid: d1ba9546a2394a84a8392d5719b29294,
type: 2}
propertyPath: m_AnchoredPosition.x
value: 599.6117
value: 599.5272
objectReference: {fileID: 0}
- target: {fileID: 224330000714602946, guid: d1ba9546a2394a84a8392d5719b29294,
type: 2}
propertyPath: m_AnchoredPosition.y
value: -81.01452
value: -80.99673
objectReference: {fileID: 0}
- target: {fileID: 224330000714602946, guid: d1ba9546a2394a84a8392d5719b29294,
type: 2}
Expand Down Expand Up @@ -4052,12 +4093,12 @@ Prefab:
- target: {fileID: 224330000714602946, guid: d1ba9546a2394a84a8392d5719b29294,
type: 2}
propertyPath: m_AnchoredPosition.x
value: 732.01465
value: 731.9091
objectReference: {fileID: 0}
- target: {fileID: 224330000714602946, guid: d1ba9546a2394a84a8392d5719b29294,
type: 2}
propertyPath: m_AnchoredPosition.y
value: -81.01452
value: -80.99673
objectReference: {fileID: 0}
- target: {fileID: 224330000714602946, guid: d1ba9546a2394a84a8392d5719b29294,
type: 2}
Expand Down Expand Up @@ -4407,6 +4448,47 @@ CanvasRenderer:
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1014244533}
--- !u!1 &1030888069
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 1030888071}
- component: {fileID: 1030888070}
m_Layer: 0
m_Name: InterfaceTester
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1030888070
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1030888069}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3a609d74af62adc4498b9be5e7c202d3, type: 3}
m_Name:
m_EditorClassIdentifier:
identifier: One
--- !u!4 &1030888071
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1030888069}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 555.54016, y: 458.44223, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 13
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1035893648
Prefab:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -5902,12 +5984,12 @@ Prefab:
- target: {fileID: 224330000714602946, guid: d1ba9546a2394a84a8392d5719b29294,
type: 2}
propertyPath: m_AnchoredPosition.x
value: 202.40292
value: 202.3818
objectReference: {fileID: 0}
- target: {fileID: 224330000714602946, guid: d1ba9546a2394a84a8392d5719b29294,
type: 2}
propertyPath: m_AnchoredPosition.y
value: -81.01452
value: -80.99673
objectReference: {fileID: 0}
- target: {fileID: 224330000714602946, guid: d1ba9546a2394a84a8392d5719b29294,
type: 2}
Expand Down Expand Up @@ -6753,12 +6835,12 @@ Prefab:
- target: {fileID: 224330000714602946, guid: d1ba9546a2394a84a8392d5719b29294,
type: 2}
propertyPath: m_AnchoredPosition.x
value: 864.41754
value: 864.29095
objectReference: {fileID: 0}
- target: {fileID: 224330000714602946, guid: d1ba9546a2394a84a8392d5719b29294,
type: 2}
propertyPath: m_AnchoredPosition.y
value: -81.01452
value: -80.99673
objectReference: {fileID: 0}
- target: {fileID: 224330000714602946, guid: d1ba9546a2394a84a8392d5719b29294,
type: 2}
Expand Down Expand Up @@ -7381,7 +7463,7 @@ Prefab:
- target: {fileID: 224330000714602946, guid: d1ba9546a2394a84a8392d5719b29294,
type: 2}
propertyPath: m_AnchoredPosition.y
value: -81.01452
value: -80.99673
objectReference: {fileID: 0}
- target: {fileID: 224330000714602946, guid: d1ba9546a2394a84a8392d5719b29294,
type: 2}
Expand Down Expand Up @@ -8132,12 +8214,12 @@ Prefab:
- target: {fileID: 224330000714602946, guid: d1ba9546a2394a84a8392d5719b29294,
type: 2}
propertyPath: m_AnchoredPosition.x
value: 467.20877
value: 467.14542
objectReference: {fileID: 0}
- target: {fileID: 224330000714602946, guid: d1ba9546a2394a84a8392d5719b29294,
type: 2}
propertyPath: m_AnchoredPosition.y
value: -81.01452
value: -80.99673
objectReference: {fileID: 0}
- target: {fileID: 224330000714602946, guid: d1ba9546a2394a84a8392d5719b29294,
type: 2}
Expand Down Expand Up @@ -8485,12 +8567,12 @@ Prefab:
- target: {fileID: 224330000714602946, guid: d1ba9546a2394a84a8392d5719b29294,
type: 2}
propertyPath: m_AnchoredPosition.x
value: 1129.2234
value: 1129.0547
objectReference: {fileID: 0}
- target: {fileID: 224330000714602946, guid: d1ba9546a2394a84a8392d5719b29294,
type: 2}
propertyPath: m_AnchoredPosition.y
value: -81.01452
value: -80.99673
objectReference: {fileID: 0}
- target: {fileID: 224330000714602946, guid: d1ba9546a2394a84a8392d5719b29294,
type: 2}
Expand Down
18 changes: 9 additions & 9 deletions Dots-RTS-Development/Assets/Scripts/AI/AI_Helper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ public static bool IsTargetOf(this Enemy_AI ai, Enemy_AI other) {
}

public static bool IsAllyOf(this Enemy_AI ai, Enemy_AI other) {
foreach (Enemy_AI temp in ai.getAllies) {
if (ai == other) {
foreach (Enemy_AI temp in other.getAllies) {
if (ai == temp) {
return true;
}
}
return false;

}

public static bool IsAllyOf(this Enemy_AI ai, Player player) {
foreach (Enemy_AI temp in ai.getAllies) {
if (ai.getCurrentAiTeam == player.theoreticalTeam) {
return true;
}
}
return false;
//public static bool IsAllyOf(this IAlly it, Player other) {
// return other.IsAllyOF(it);
//}

public static bool IsAllyOf(this IAlly it, IAlly other) {
return other.IsAllyOF(it);
}

public static void AddAlly(this Enemy_AI ai, Enemy_AI ally) {
Expand Down
12 changes: 10 additions & 2 deletions Dots-RTS-Development/Assets/Scripts/AI/Enemy_AI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
using System.Collections.Generic;
using UnityEngine;

public class Enemy_AI : MonoBehaviour {

public class Enemy_AI : MonoBehaviour, IAlly {

public bool isActive = true;

Expand Down Expand Up @@ -478,6 +477,9 @@ private DataHolder GetCellInstances(CellBehaviour referenceCell, Enemy_AI ai) {
/// <param name="is_Adding">Is the selected process addition or deletion -- not implemented</param>
/// <param name="ai">The Ai to operate on, default points to the one specified in DataHolder</param>
private void ProcessData(DataHolder data, bool is_Adding, Enemy_AI ai = null) {

this.IsAllyOf(ai);

if (ai == null) {
ai = data.getAI;
}
Expand Down Expand Up @@ -534,6 +536,12 @@ private void ProcessData(DataHolder data, bool is_Adding, Enemy_AI ai = null) {
}
}

public bool IsAllyOF(IAlly other) {
// Enemy_AI ai = (Enemy_AI)other;
// print(ai.aiTeam);
return false;
}

#region Getters and Operators
/// <summary>
/// Get current AIs Team
Expand Down
23 changes: 23 additions & 0 deletions Dots-RTS-Development/Assets/Scripts/AI/Interfaces.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using UnityEngine;
using System.Collections;
using System;
using System.Collections.Generic;

public interface IAlly {
bool IsAllyOF(IAlly other);

}

public static class IAllyExtension {
public static bool IsAllyOf(this IAlly it, Player p ) {
return p.IsAllyOF(it);
}

public static bool IsAllyOf(this Enemy_AI p, IAlly it) {
return p.IsAllyOF(it);
}
public static bool IsAllyOf(this IAlly it, IAlly p) {
return p.IsAllyOF(it);
}
}

12 changes: 12 additions & 0 deletions Dots-RTS-Development/Assets/Scripts/AI/Interfaces.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public static async Task FillUpgradeSpriteDict() {

for (int i = 0; i < values.Length; i++) {
if(values[i] != -1) {
print(values[i]);
//print(values[i]);
t[i] = GetSprite((Upgrades)values[i]);
}
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading