Skip to content

Commit 4015dac

Browse files
author
Chris Elion
authored
[MLA-1912] Move Match3 to com.unity.ml-agents (#5259)
1 parent 9e5b584 commit 4015dac

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+57
-44
lines changed

Project/Assets/ML-Agents/Examples/Match3/Scripts/Match3Agent.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
using UnityEngine;
33
using Unity.MLAgents;
44
using Unity.MLAgents.Actuators;
5-
using Unity.MLAgents.Extensions.Match3;
5+
using Unity.MLAgents.Integrations.Match3;
66

77
namespace Unity.MLAgentsExamples
88
{

Project/Assets/ML-Agents/Examples/Match3/Scripts/Match3Board.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using System;
2-
using Unity.MLAgents.Extensions.Match3;
2+
using Unity.MLAgents.Integrations.Match3;
33
using UnityEngine;
44
using UnityEngine.Serialization;
55

Project/Assets/ML-Agents/Examples/Match3/Scripts/Match3ExampleActuator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using Unity.MLAgents;
2-
using Unity.MLAgents.Extensions.Match3;
2+
using Unity.MLAgents.Integrations.Match3;
33

44
namespace Unity.MLAgentsExamples
55
{

Project/Assets/ML-Agents/Examples/Match3/Scripts/Match3ExampleActuatorComponent.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using Unity.MLAgents;
22
using Unity.MLAgents.Actuators;
3-
using Unity.MLAgents.Extensions.Match3;
3+
using Unity.MLAgents.Integrations.Match3;
44

55
namespace Unity.MLAgentsExamples
66
{

com.unity.ml-agents.extensions/Documentation~/com.unity.ml-agents.extensions.md

Lines changed: 1 addition & 2 deletions

com.unity.ml-agents/CHANGELOG.md

Lines changed: 1 addition & 0 deletions

com.unity.ml-agents/Documentation~/com.unity.ml-agents.md

Lines changed: 8 additions & 7 deletions

com.unity.ml-agents/Runtime/Integrations.meta

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

com.unity.ml-agents.extensions/Runtime/Match3/AbstractBoard.cs renamed to com.unity.ml-agents/Runtime/Integrations/Match3/AbstractBoard.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
using UnityEngine;
55
using Debug = UnityEngine.Debug;
66

7-
namespace Unity.MLAgents.Extensions.Match3
7+
namespace Unity.MLAgents.Integrations.Match3
88
{
99
/// <summary>
10-
/// Representation of the AbstractBoard size and number of cell and special types.
10+
/// Representation of the AbstractBoard dimensions, and number of cell and special types.
1111
/// </summary>
1212
public struct BoardSize
1313
{
@@ -125,7 +125,7 @@ public virtual BoardSize GetCurrentBoardSize()
125125
public abstract bool IsMoveValid(Move m);
126126

127127
/// <summary>
128-
/// Instruct the game to make the given move. Returns true if the move was made.
128+
/// Instruct the game to make the given Move. Returns true if the move was made.
129129
/// Note that during training, a move that was marked as invalid may occasionally still be
130130
/// requested. If this happens, it is safe to do nothing and request another move.
131131
/// </summary>

com.unity.ml-agents.extensions/Runtime/Match3/Match3Actuator.cs renamed to com.unity.ml-agents/Runtime/Integrations/Match3/Match3Actuator.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
using Debug = UnityEngine.Debug;
33

44

5-
namespace Unity.MLAgents.Extensions.Match3
5+
namespace Unity.MLAgents.Integrations.Match3
66
{
77
/// <summary>
88
/// Actuator for a Match3 game. It translates valid moves (defined by AbstractBoard.IsMoveValid())
@@ -23,7 +23,6 @@ public class Match3Actuator : IActuator, IBuiltInActuator
2323
/// <param name="forceHeuristic">Whether the inference action should be ignored and the Agent's Heuristic
2424
/// should be called. This should only be used for generating comparison stats of the Heuristic.</param>
2525
/// <param name="seed">The seed used to initialize <see cref="System.Random"/>.</param>
26-
/// <param name="agent"></param>
2726
/// <param name="name"></param>
2827
public Match3Actuator(AbstractBoard board,
2928
bool forceHeuristic,

com.unity.ml-agents.extensions/Runtime/Match3/Match3ActuatorComponent.cs renamed to com.unity.ml-agents/Runtime/Integrations/Match3/Match3ActuatorComponent.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
using UnityEngine;
33
using UnityEngine.Serialization;
44

5-
namespace Unity.MLAgents.Extensions.Match3
5+
namespace Unity.MLAgents.Integrations.Match3
66
{
77
/// <summary>
88
/// Actuator component for a Match3 game. Generates a Match3Actuator at runtime.

com.unity.ml-agents.extensions/Runtime/Match3/Match3Sensor.cs renamed to com.unity.ml-agents/Runtime/Integrations/Match3/Match3Sensor.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
using Unity.MLAgents.Sensors;
44
using UnityEngine;
55

6-
namespace Unity.MLAgents.Extensions.Match3
6+
namespace Unity.MLAgents.Integrations.Match3
77
{
88
/// <summary>
99
/// Delegate that provides integer values at a given (x,y) coordinate.
@@ -164,7 +164,6 @@ public int Write(ObservationWriter writer)
164164
}
165165
}
166166

167-
168167
return offset;
169168
}
170169

com.unity.ml-agents.extensions/Runtime/Match3/Match3SensorComponent.cs renamed to com.unity.ml-agents/Runtime/Integrations/Match3/Match3SensorComponent.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
using Unity.MLAgents.Sensors;
33
using UnityEngine;
44

5-
namespace Unity.MLAgents.Extensions.Match3
5+
namespace Unity.MLAgents.Integrations.Match3
66
{
77
/// <summary>
88
/// Sensor component for a Match3 game.

com.unity.ml-agents.extensions/Runtime/Match3/Move.cs renamed to com.unity.ml-agents/Runtime/Integrations/Match3/Move.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System;
22
using UnityEngine;
33

4-
namespace Unity.MLAgents.Extensions.Match3
4+
namespace Unity.MLAgents.Integrations.Match3
55
{
66
/// <summary>
77
/// Directions for a Move.
@@ -141,7 +141,7 @@ public void Next(BoardSize maxBoardSize)
141141
}
142142

143143
/// <summary>
144-
/// Construct a Move from the row, column, and direction.
144+
/// Construct a Move from the row, column, direction, and board size.
145145
/// </summary>
146146
/// <param name="row"></param>
147147
/// <param name="col"></param>

com.unity.ml-agents/Tests/Editor/Integrations.meta

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

com.unity.ml-agents.extensions/Tests/Editor/Match3/AbstractBoardTests.cs renamed to com.unity.ml-agents/Tests/Editor/Integrations/Match3/AbstractBoardTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
using System.Collections.Generic;
33
using UnityEngine;
44
using NUnit.Framework;
5-
using Unity.MLAgents.Extensions.Match3;
5+
using Unity.MLAgents.Integrations.Match3;
66

7-
namespace Unity.MLAgents.Extensions.Tests.Match3
7+
namespace Unity.MLAgents.Tests.Integrations.Match3
88
{
99
internal class StringBoard : AbstractBoard
1010
{

com.unity.ml-agents.extensions/Tests/Editor/Match3/Match3ActuatorTests.cs renamed to com.unity.ml-agents/Tests/Editor/Integrations/Match3/Match3ActuatorTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
using System.Collections.Generic;
22
using NUnit.Framework;
33
using Unity.MLAgents.Actuators;
4-
using Unity.MLAgents.Extensions.Match3;
4+
using Unity.MLAgents.Integrations.Match3;
55
using UnityEngine;
66

7-
namespace Unity.MLAgents.Extensions.Tests.Match3
7+
namespace Unity.MLAgents.Tests.Integrations.Match3
88
{
99
internal class SimpleBoard : AbstractBoard
1010
{

com.unity.ml-agents.extensions/Tests/Editor/Match3/Match3SensorTests.cs renamed to com.unity.ml-agents/Tests/Editor/Integrations/Match3/Match3SensorTests.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
using System.IO;
33
using System.Reflection;
44
using NUnit.Framework;
5-
using Unity.MLAgents.Extensions.Match3;
65
using UnityEngine;
7-
using Unity.MLAgents.Extensions.Tests.Sensors;
6+
using Unity.MLAgents.Integrations.Match3;
87
using Unity.MLAgents.Sensors;
8+
using Unity.MLAgents.Tests;
99

10-
namespace Unity.MLAgents.Extensions.Tests.Match3
10+
namespace Unity.MLAgents.Tests.Integrations.Match3
1111
{
1212
public class Match3SensorTests
1313
{
@@ -373,7 +373,7 @@ void SavePNGs(byte[] concatenatedPngData, string pathPrefix)
373373
for (var i = 0; i < splitPngs.Count; i++)
374374
{
375375
var pngData = splitPngs[i];
376-
var path = $"Packages/com.unity.ml-agents.extensions/Tests/Editor/Match3/{pathPrefix}{i}.png";
376+
var path = $"Packages/com.unity.ml-agents/Tests/Editor/Integrations/Match3/{pathPrefix}{i}.png";
377377
using (var sw = File.Create(path))
378378
{
379379
foreach (var b in pngData)
@@ -389,7 +389,7 @@ byte[] LoadPNGs(string pathPrefix, int numExpected)
389389
var bytesOut = new List<byte>();
390390
for (var i = 0; i < numExpected; i++)
391391
{
392-
var path = $"Packages/com.unity.ml-agents.extensions/Tests/Editor/Match3/{pathPrefix}{i}.png";
392+
var path = $"Packages/com.unity.ml-agents/Tests/Editor/Integrations/Match3/{pathPrefix}{i}.png";
393393
var res = File.ReadAllBytes(path);
394394
bytesOut.AddRange(res);
395395
}

com.unity.ml-agents.extensions/Tests/Editor/Match3/MoveTests.cs renamed to com.unity.ml-agents/Tests/Editor/Integrations/Match3/MoveTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
using System;
22
using NUnit.Framework;
3-
using Unity.MLAgents.Extensions.Match3;
3+
using Unity.MLAgents.Integrations.Match3;
44

5-
namespace Unity.MLAgents.Extensions.Tests.Match3
5+
namespace Unity.MLAgents.Tests.Integrations.Match3
66
{
77
public class MoveTests
88
{

com.unity.ml-agents/Tests/Editor/Unity.ML-Agents.Editor.Tests.asmdef

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"Unity.ML-Agents",
66
"Unity.Barracuda",
77
"Unity.ML-Agents.CommunicatorObjects",
8-
"Unity.ML-Agents.Runtime.Utils.Tests"
8+
"Unity.ML-Agents.Runtime.Utils.Tests",
9+
"Unity.ML-Agents.Runtime.Sensor.Tests"
910
],
1011
"optionalUnityReferences": [
1112
"TestAssemblies"

com.unity.ml-agents.extensions/Documentation~/Match3.md renamed to docs/Integrations-Match3.md

Lines changed: 3 additions & 8 deletions

docs/Integrations.md

Lines changed: 10 additions & 0 deletions

docs/Migrating.md

Lines changed: 2 additions & 0 deletions

0 commit comments

Comments
 (0)