summaryrefslogtreecommitdiff
path: root/code/common/AbstractHandler.cs
blob: 7387e21fce25b4d671a5732dae04885d42a88414 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
using System;

namespace common
{
    public abstract class AbstractHandler<T> : Handler<T>, Handler
    {
        bool can_handle(Type type)
        {
            return typeof (T).Equals(type);
        }

        public void handle(object item)
        {
            if (can_handle(item.GetType()))
            {
                handle((T) item);
            }
        }

        public abstract void handle(T item);
    }
}