Beispiel #1
0
        public void Clear()
        {
            Suggestions = null;
            Unit = null;
            OraclePresense = new List<Point>();

            OnUpdated();
        }
 private Map CreateMap(string[] mapLines, Unit unit)
 {
     var f = new bool[mapLines[0].Length, mapLines.Length];
     for(int y=0; y<mapLines.Length; y++)
         for (int x = 0; x < mapLines[0].Length; x++)
             f[x, y] = mapLines[y][x] == '#';
     var positionedUnit = new PositionedUnit(unit, new UnitPosition(new Point(3, 0), 0));
     return new Map(0, f, positionedUnit, ImmutableStack<Unit>.Empty, ImmutableHashSet<PositionedUnit>.Empty, new Scores(0, 0));
 }
Beispiel #3
0
        public void Load(IEnumerable<OracleSuggestion> suggestions, Unit unit)
        {
            Position = 0;
            Unit = unit;
            Suggestions = suggestions.ToList();
            OraclePresense = Suggestions
                .Take(200)
                .Select(z => new PositionedUnit(unit, z.Position))
                .SelectMany(z => z.Members)
                .Distinct()
                .ToList();

            OnUpdated();
        }
Beispiel #4
0
 public PositionedUnit(Unit unit, UnitPosition position)
 {
     Unit = unit;
     Position = position;
 }
Beispiel #5
0
 public PositionedUnit(Unit unit, int rotationIndex, Point pivotLocation)
 {
     Unit = unit;
     Position = new UnitPosition(pivotLocation, (rotationIndex + Unit.Period) % Unit.Period);
 }