Files
tictactoe/Gameplay/Goal.cs

74 lines
3.4 KiB
C#

using Godot;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
public partial class Goal : Node
{
public Dictionary<GoalName, List<int>> _conditions = new()
{
{GoalName.TopRow, new (){0,1,2}},
{GoalName.MiddleRow, new (){3,4,5}},
{GoalName.BottomRow, new (){6,7,8}},
{GoalName.LeftColumn, new (){0,3,6}},
{GoalName.MiddleColumn, new (){1,4,7}},
{GoalName.RightColumn, new (){2,5,8}},
{GoalName.Diagonal1To9, new (){0,4,8}},
{GoalName.Diagonal3To7, new (){2,4,6}},
{GoalName.Number1, new (){0,1,4,6,7,8}},
{GoalName.Number2, new (){0,1,3,4,7,8}},
{GoalName.Number3, new (){0,1,4,5,6,7}},
{GoalName.Number4, new (){0,2,3,4,5,8}},
{GoalName.Number5, new (){1,2,3,4,6,7}},
{GoalName.Number6, new (){0,3,4,5,6,7,8}},
{GoalName.Number7, new (){0,1,2,5,8}},
{GoalName.Number8, new (){1,2,3,4,5,6,7}},
{GoalName.Number9, new (){0,1,2,3,4,5,7,8}},
{GoalName.Number0, new (){1,2,3,5,6,7}},
{GoalName.LetterA, new (){1,3,4,5,6,8}},
{GoalName.LetterB, new (){0,1,3,4,5,6,7,8}},
{GoalName.LetterC, new (){0,1,2,3,6,7,8}},
{GoalName.LetterD, new (){0,1,3,5,6,7}},
{GoalName.LetterE, new (){0,1,2,3,4,6,7,8}},
{GoalName.LetterF, new (){0,1,2,3,4,6}},
{GoalName.LetterG, new (){0,1,3,5,6,7,8}},
{GoalName.LetterH, new (){0,2,3,4,5,6,8}},
{GoalName.LetterI, new (){0,1,2,4,6,7,8}},
{GoalName.LetterJ, new (){0,1,2,4,6,7}},
{GoalName.LetterK, new (){0,2,3,4,6,8}},
{GoalName.LetterL, new (){2,4,6,7,8}},
{GoalName.LetterM, new (){0,1,2,3,4,5,6,8}},
{GoalName.LetterN, new (){0,1,2,3,5,6,8}},
{GoalName.LetterO, new (){0,1,2,3,5,6,7,8}},
{GoalName.LetterP, new (){0,1,2,3,4,5,6}},
{GoalName.LetterQ, new (){0,1,2,3,5,6,7}},
{GoalName.LetterR, new (){0,1,2,3,4,6,8}},
{GoalName.LetterS, new (){1,2,4,6,7}},
{GoalName.LetterT, new (){0,1,2,4,7}},
{GoalName.LetterU, new (){0,2,3,5,6,7,8}},
{GoalName.LetterV, new (){0,2,3,5,7}},
{GoalName.LetterW, new (){0,2,3,4,5,6,7,8}},
{GoalName.LetterX, new (){0,2,4,6,8}},
{GoalName.LetterY, new (){0,2,4,7}},
{GoalName.LetterZ, new (){0,1,4,7,8}},
{GoalName.LongRightAngleAt1, new (){0,1,2,3,6}},
{GoalName.LongRightAngleAt3, new (){0,1,2,5,8}},
{GoalName.LongRightAngleAt7, new (){0,3,6,7,8}},
{GoalName.LongRightAngleAt9, new (){2,5,6,7,8}},
{GoalName.ShortRightAngleAt1, new (){0,1,3}},
{GoalName.ShortRightAngleAt3, new (){1,2,5}},
{GoalName.ShortRightAngleAt7, new (){3,6,7}},
{GoalName.ShortRightAngleAt9, new (){5,7,8}},
{GoalName.Corners, new (){0,3,6,8}},
{GoalName.Diamond, new (){1,3,5,7}},
{GoalName.Blackout, new (){0,1,2,3,4,5,6,7,8}},
};
public List<int> GetAddresses(GoalName NAME)
{
return _conditions[NAME];
}
}