﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PA.TileList.Contextual
{
    public class Contextual<T> : IContextual<T>
        where T : ICoordinate
    {
        public int X { get;  set; }
        public int Y { get;  set; }

        public T Context { get; private set; }

        public Contextual(int x, int y, T context)
        {
            this.X = x;
            this.Y = y;
            this.Context = context;
        }

        public ICoordinate Clone()
        {
            return this.MemberwiseClone() as ICoordinate;
        }
    }
}

﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PA.TileList.Contextual
{
    public class Contextual<T> : Coordinate, IContextual<T>
        where T : ICoordinate
    {

        public T Context { get; private set; }

        public Contextual(int x, int y, T context)
            : base(x, y)
        {
            this.Context = context;
        }

        public override string ToString()
        {
            return base.ToString() + " [" + this.Context.ToString() + "]";
        }
    }
}

Define contextual as coordinate subclass
Define contextual as coordinate subclass
