54
|
1 |
using System; |
|
2 |
using System.Collections.Generic; |
|
3 |
using System.Linq; |
|
4 |
using System.Text; |
|
5 |
using FingersDance.Actions; |
|
6 |
|
|
7 |
namespace FingersDance.ActionFactory |
|
8 |
{ |
|
9 |
public class ActionGenerator |
|
10 |
{ |
|
11 |
private Dictionary<String, Type> actionDict = new Dictionary<string, Type>(); |
|
12 |
|
|
13 |
public ActionGenerator() |
|
14 |
{ |
|
15 |
actionDict.Add("ActionPlayMedia", typeof(FingersDance.Actions.ActionPlayMedia)); |
|
16 |
actionDict.Add("ActionShowMessage", typeof(FingersDance.Actions.ActionShowMessage)); |
|
17 |
actionDict.Add("ActionOpenMedia", typeof(FingersDance.Actions.ActionOpenMedia)); |
|
18 |
actionDict.Add("ActionStopMedia", typeof(FingersDance.Actions.ActionStopMedia)); |
|
19 |
} |
|
20 |
|
|
21 |
public ActionBase GetAction(string T, object Args) |
|
22 |
{ |
|
23 |
return (ActionBase)Activator.CreateInstance(actionDict[T]); |
|
24 |
} |
|
25 |
} |
|
26 |
} |