Exemplo n.º 1
0
        public void LoadSessions(Session leftSession, Session rightSession)
        {
            _leftSession = leftSession;
            _rightSession = rightSession;
            
            _matches = new List<TileMatch>();
            var leftHash = _leftSession.GenerateHash();
            var rightHash = rightSession.GenerateHash();

            Session.Tile leftTile;
            Session.Tile rightTile;
            foreach (var tileHash in leftHash.Keys)
            {
                leftTile = leftHash[tileHash];
                rightHash.TryGetValue(tileHash, out rightTile);

                if (rightTile != null)
                {
                    var match = new TileMatch()
                    {
                        LeftPoint = new Point(leftTile.X, leftTile.Y),
                        RightPoint = new Point(rightTile.X, rightTile.Y)
                    };
                    _matches.Add(match);
                }
            }

            _currentMatchIndex = 0;

            rightSessionPictureBox.UpdateSession(_rightSession);
            leftSessionPictureBox.UpdateSession(_leftSession);

            UpdateMatch();
        }
        public void LoadSessions(Session leftSession, Session rightSession)
        {
            _leftSession  = leftSession;
            _rightSession = rightSession;

            _matches = new List <TileMatch>();
            var leftHash  = _leftSession.GenerateHash();
            var rightHash = rightSession.GenerateHash();

            Session.Tile leftTile;
            Session.Tile rightTile;
            foreach (var tileHash in leftHash.Keys)
            {
                leftTile = leftHash[tileHash];
                rightHash.TryGetValue(tileHash, out rightTile);

                if (rightTile != null)
                {
                    var match = new TileMatch()
                    {
                        LeftPoint  = new Point(leftTile.X, leftTile.Y),
                        RightPoint = new Point(rightTile.X, rightTile.Y)
                    };
                    _matches.Add(match);
                }
            }

            _currentMatchIndex = 0;

            rightSessionPictureBox.UpdateSession(_rightSession);
            leftSessionPictureBox.UpdateSession(_leftSession);

            UpdateMatch();
        }
Exemplo n.º 3
0
 public ScoreUpdateArgs(int scoreDifference, int comboCount, int currentScore, TileMatch tileMatch)
 {
     ScoreDifference = scoreDifference;
     ComboCount      = comboCount;
     CurrentScore    = currentScore;
     TileMatch       = tileMatch;
 }
Exemplo n.º 4
0
// END CUT HERE
// BEGIN CUT HERE
    public static void Main()
    {
        try {
            TileMatch ___test = new TileMatch();
            ___test.run_test(-1);
        } catch (Exception e) {
//Console.WriteLine(e.StackTrace);
            Console.WriteLine(e.ToString());
        }
    }
Exemplo n.º 5
0
 // END CUT HERE
 // BEGIN CUT HERE
 public static void Main()
 {
     try {
     TileMatch ___test = new TileMatch();
     ___test.run_test(-1);
     } catch(Exception e) {
     //Console.WriteLine(e.StackTrace);
     Console.WriteLine(e.ToString());
     }
 }
Exemplo n.º 6
0
        public static List <TileMatch> PlaceMap(IEnumerable <TileMatch> tileMatches)
        {
            var tileMatch = tileMatches.ToDictionary(match => match.Tile.Id);

            return(TileMatch.Handle(tileMatch).Select(x => x.Value).ToList());
        }
Exemplo n.º 7
0
 public TileMatchArgs(TileMatch tileMatch, int combo)
 {
     TileMatch = tileMatch;
     Combo     = combo;
 }