• R/O
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

FreeTrainの進化系を目指す


Commit MetaInfo

Revision17 (tree)
Time2014-03-10 22:29:01
Authorc477

Log Message

画像オーバーライドの定義と管理:一応実装完了

Change Summary

Incremental Difference

--- trunk/core/contributions/graphics/CtbImageResource.cs (revision 16)
+++ trunk/core/contributions/graphics/CtbImageResource.cs (revision 17)
@@ -9,11 +9,32 @@
99 using System.Drawing;
1010 using System.IO;
1111 using nft.core;
12+using nft.core.view;
1213
1314 namespace nft.contributions.graphics
1415 {
15- public class CtbImageResource : Contribution
16+ public class CtbImageResource : Contribution {
17+ protected ConditionedResource<ImageResource> conditionedResource;
18+
19+ public CtbImageResource(Plugin owner, ParamsReader contrib) : base(owner, contrib)
20+ {
21+ conditionedResource = ConditionedResourceFactory.LoadAsConditiondResources<ImageResource>(contrib, new ResourceParser<ImageResource>(Parse));
22+ }
23+
24+ protected ImageResource Parse(ParamsReader reader) {
25+ return new ImageResource(Parent, reader);
26+ }
27+
28+ public ConditionedResource<ImageResource> Data {
29+ get {
30+ return conditionedResource;
31+ }
32+ }
33+ }
34+
35+ public class ImageResource
1636 {
37+ protected ResourceKey res_key;
1738 protected WeakReference reffer;
1839 protected Color colorkey;
1940 protected bool auto_color_key;
@@ -20,7 +41,7 @@
2041 protected string src_text;
2142 protected IFileSource file;
2243
23- public CtbImageResource(Plugin owner, ParamsReader contrib) :base(owner, contrib)
44+ public ImageResource(Plugin owner, ParamsReader contrib)
2445 {
2546 reffer = null;
2647 ParamsReader nd = contrib["src"];
@@ -36,7 +57,7 @@
3657 {
3758 colorkey = StringParseUtil.CreateColor(ckey.InnerText);
3859 }
39-
60+ res_key = ResourceKey.CreateKey(owner, SrcText);
4061 }
4162
4263 protected string SrcText
@@ -58,13 +79,12 @@
5879 return (IImageSrc)reffer.Target;
5980 } else {
6081 // Image file might be shared by contributions in the same plugin. So assign plugin key.
61- ResourceKey key = ResourceKey.CreateKey(Parent, SrcText);
6282 IImageSrc img;
6383 if (auto_color_key) {
6484 // use left-bottom pixel as color-key
65- img = GraphicManagerEx.GraphicManager.LoadImageFromFileWithDefaultColorKey(key, File);
85+ img = GraphicManagerEx.GraphicManager.LoadImageFromFileWithDefaultColorKey(res_key, File);
6686 } else {
67- img = GraphicManagerEx.GraphicManager.LoadImageFromFile(key, File, colorkey);
87+ img = GraphicManagerEx.GraphicManager.LoadImageFromFile(res_key, File, colorkey);
6888 }
6989 reffer = new WeakReference(img);
7090 return img;
--- trunk/core/contributions/graphics/OverrideTable.cs (revision 16)
+++ trunk/core/contributions/graphics/OverrideTable.cs (revision 17)
@@ -7,6 +7,7 @@
77 /// <summary>
88 /// 画像などのオーバライドテーブルを保持する
99 /// </summary>
10+ /// 2014/03/02 現時点で未使用、破棄の方向
1011 /// <typeparam name="Type"></typeparam>
1112 public class OverrideTable<Type> {
1213 public delegate Type ElementParser(XmlElement e);
--- trunk/core/debug/TestXnaForm.cs (revision 16)
+++ trunk/core/debug/TestXnaForm.cs (revision 17)
@@ -32,8 +32,8 @@
3232 {
3333 CtbImageResource ir1 = PluginManager.theInstance.GetContribution(@"test\tex112x136x96") as CtbImageResource;
3434 CtbImageResource ir2 = PluginManager.theInstance.GetContribution(@"test\tex32x48x56") as CtbImageResource;
35- ITexture tx1 = GM.CreateStaticTexture(ResourceKey.CreateKey(ir1, ir2.ID), ir1.ImageSrc);
36- ITexture tx2 = GM.CreateStaticTexture(ResourceKey.CreateKey(ir2, ir2.ID), ir2.ImageSrc);
35+ ITexture tx1 = GM.CreateStaticTexture(ResourceKey.CreateKey(ir1, ir2.ID), ir1.Data.Default.ImageSrc);
36+ ITexture tx2 = GM.CreateStaticTexture(ResourceKey.CreateKey(ir2, ir2.ID), ir2.Data.Default.ImageSrc);
3737 ICubicStructure st1 = GM.CreateStructure(0, null, tx1, new Point3D(112, 96, 136));
3838 ICubicStructure st2 = GM.CreateStructure(0, null, tx2, new Point3D(32, 56, 48));
3939 st1.Location = new PointF3D(40f, -20f, -40f);
--- trunk/core/core/view/ConditiondResourceFactory.cs (revision 16)
+++ trunk/core/core/view/ConditiondResourceFactory.cs (nonexistent)
@@ -1,71 +0,0 @@
1-using System;
2-using System.Collections.Generic;
3-using System.Text;
4-using nft.framework.drawing;
5-using nft.framework;
6-using nft.framework.plugin;
7-
8-namespace nft.core.view
9-{
10- public delegate T ResourceParser<T>(ParamsReader reader);
11-
12- public class ConditionedResourceFactory
13- {
14- static private readonly string VALUE_NODE = "default|value";
15- static private readonly string CONDITION_NODE = "condition";
16- static private readonly string CONDITION_TYPE_ATTR = "when";
17-
18- static private Dictionary<string, IConditionFactory> factories = new Dictionary<string, IConditionFactory>();
19-
20- public static void RegisterConditionFactory(string name, IConditionFactory fct){
21- factories.Add(name, fct);
22- }
23-
24- public static ConditionedResource<T> LoadAsConditiondResources<T>(ParamsReader resource, ResourceParser<T> callback){
25- ParamsReader dnode = resource[VALUE_NODE];
26- T _default = callback(dnode.IsNull ? resource : dnode);
27- ParamsReader conds = resource[CONDITION_NODE];
28- if (conds.IsNull) {
29- return new ConditionedResource<T>(_default);
30- } else {
31- NestedConditionsResouceRoot<T> ret = new NestedConditionsResouceRoot<T>(_default);
32- foreach (ParamsReader child in conds.Each) {
33- ConditionedResource<T> temp = LoadChildConditions(resource, callback);
34- ret.AddChild(temp);
35- }
36- return AdaptOptimization<T>(ret);
37- }
38- }
39-
40- #region private functions
41- private static ConditionedResource<T> LoadChildConditions<T>(ParamsReader resource, ResourceParser<T> callback){
42- ISceneCondition sc = GetConditionFor(resource);
43- ParamsReader dnode = resource[VALUE_NODE];
44- T _default = callback(dnode.IsNull ? resource : dnode);
45- ParamsReader conds = resource[CONDITION_NODE];
46- if (conds.IsNull) {
47- return new SingleConditionResouce<T>(sc,_default);
48- } else {
49- NestedConditionsResouce<T> ret = new NestedConditionsResouce<T>(sc, _default);
50- foreach (ParamsReader child in conds.Each) {
51- ConditionedResource<T> temp = LoadChildConditions(resource, callback);
52- ret.AddChild(temp);
53- }
54- return AdaptOptimization<T>(ret);
55- }
56- }
57-
58- private static ConditionedResource<T> AdaptOptimization<T>(NestedConditionsResouceRoot<T> orig) {
59- return orig;
60- }
61-
62- private static ISceneCondition GetConditionFor(ParamsReader reader) {
63- ParamsReader pr2 = reader[CONDITION_TYPE_ATTR];
64- if (pr2.IsNull) throw new PluginXmlException(reader, "");
65- string attr = pr2.InnerText;
66-
67- return null;
68- }
69- #endregion
70- }
71-}
--- trunk/core/core/view/ConditiondResource.cs (revision 16)
+++ trunk/core/core/view/ConditiondResource.cs (nonexistent)
@@ -1,85 +0,0 @@
1-using System;
2-using System.Collections.Generic;
3-using System.Text;
4-
5-namespace nft.core.view
6-{
7- public class ConditionedResource<T>
8- {
9- internal protected T Default;
10-
11- public ConditionedResource(T _default) {
12- this.Default = _default;
13- }
14-
15- public T this[ISceneParams p] {
16- get {
17- T result = this.Default;
18- Choose(p, ref result);
19- return result;
20- }
21- }
22-
23- internal protected virtual bool Choose(ISceneParams p, ref T res){
24- res = Default;
25- return true;
26- }
27- }
28-
29- internal class SingleConditionResouce<T> : ConditionedResource<T>
30- {
31- protected readonly ISceneCondition Condition;
32- internal SingleConditionResouce(ISceneCondition cond, T val) :base(val){
33- this.Condition = cond;
34- }
35-
36- internal protected override bool Choose(ISceneParams p, ref T res) {
37- if (Condition.IsMatch(p)) {
38- res = Default;
39- return true;
40- } else {
41- return false;
42- }
43- }
44- }
45-
46- internal class NestedConditionsResouceRoot<T> : ConditionedResource<T>
47- {
48- internal protected readonly List<ConditionedResource<T>> children;
49- internal NestedConditionsResouceRoot(T val)
50- : base(val) {
51- this.children = new List<ConditionedResource<T>>();
52- }
53-
54- internal protected override bool Choose(ISceneParams p, ref T res) {
55- foreach (ConditionedResource<T> cc in children) {
56- if (cc.Choose(p, ref res)) {
57- return true;
58- }
59- }
60- res = Default;
61- return true;
62- }
63-
64- public void AddChild(ConditionedResource<T> child) {
65- children.Add(child);
66- }
67- }
68-
69- internal class NestedConditionsResouce<T> : NestedConditionsResouceRoot<T>
70- {
71- internal protected readonly ISceneCondition Condition;
72- internal NestedConditionsResouce(ISceneCondition cond, T val)
73- : base(val) {
74- this.Condition = cond;
75- }
76-
77- internal protected override bool Choose(ISceneParams p, ref T res) {
78- if (Condition.IsMatch(p)) {
79- return base.Choose(p, ref res);
80- } else {
81- return false;
82- }
83- }
84- }
85-}
--- trunk/core/core/view/ISceneCondition.cs (revision 16)
+++ trunk/core/core/view/ISceneCondition.cs (revision 17)
@@ -45,13 +45,30 @@
4545 bool IsMatch(ISceneParams p);
4646 }
4747
48- public interface IComparablesCondition {
49- IComparable From { get; }
50-
48+ /// <summary>
49+ /// This interface should be declared for the ISceneConditions which based on
50+ /// 'Time' (based on the Calendar in the game) condition(s).
51+ /// If there are several ITimeRangeConditions with the same ConditionType, They can union to include them all.
52+ /// Which can be a new ITimeRangeCondition.
53+ ///
54+ /// このインターフェースはTimeクラスを条件としたISceneConditionで実装されることを想定している
55+ /// もし、同じConditionTypeを持つ複数のITimeRangeConditionが存在するなら、
56+ /// その両方を同時に含む期間を定義することができ、それを条件とした新たなITimeRangeConditionとなりうる。
57+ /// </summary>
58+ public interface ITimeRangeCondition {
5159 /// <summary>
52- /// Until is null when the condition check only if a value match.
60+ /// returns true if this condition is after the scene
5361 /// </summary>
54- IComparable Until { get; }
62+ /// <param name="p"></param>
63+ /// <returns></returns>
64+ bool IsAfter(ISceneParams p);
65+
66+ /// <summary>
67+ /// returns true if this condition is before the scene
68+ /// </summary>
69+ /// <param name="p"></param>
70+ /// <returns></returns>
71+ bool IsBefore(ISceneParams p);
5572 }
5673
5774 }
--- trunk/core/core/view/ConditionedResourceFactory.cs (nonexistent)
+++ trunk/core/core/view/ConditionedResourceFactory.cs (revision 17)
@@ -0,0 +1,103 @@
1+using System;
2+using System.Collections.Generic;
3+using System.Text;
4+using nft.framework.drawing;
5+using nft.framework;
6+using nft.framework.plugin;
7+using nft.core.schedule;
8+using System.Diagnostics;
9+
10+namespace nft.core.view
11+{
12+ public delegate T ResourceParser<T>(ParamsReader reader);
13+
14+ public class ConditionedResourceFactory
15+ {
16+ static private readonly string VALUE_NODE = "default|value";
17+ static private readonly string CONDITION_NODE = "condition";
18+ static private readonly string CONDITION_DESC_ATTR = "when";
19+
20+ static private List<IConditionFactory> factories = new List<IConditionFactory>();
21+
22+ public static void RegisterConditionFactory(IConditionFactory fct){
23+ factories.Add(fct);
24+ }
25+
26+ private static string debug_indent = "";
27+ public static ConditionedResource<T> LoadAsConditiondResources<T>(ParamsReader resource, ResourceParser<T> callback){
28+ ParamsReader dnode = resource[VALUE_NODE];
29+ T _default = callback(dnode.IsNull ? resource : dnode);
30+ ParamsReader conds = resource[CONDITION_NODE];
31+#if DEBUG
32+ debug_indent = "";
33+ Debug.WriteLine("default value = " + _default);
34+#endif
35+ if (conds.IsNull) {
36+ Debug.WriteLine("NO condition");
37+ return new ConditionedResource<T>(_default);
38+ } else {
39+ NestedConditionsResouceRoot<T> ret = new NestedConditionsResouceRoot<T>(_default);
40+ Debug.WriteLine("+condition:"+ret);
41+ foreach (ParamsReader child in conds.Each) {
42+ ConditionedResource<T> temp = LoadChildConditions(child, callback);
43+ ret.AddChild(temp);
44+ }
45+ return ApplyOptimization<T>(ret);
46+ }
47+ }
48+
49+ #region private functions
50+ private static ConditionedResource<T> LoadChildConditions<T>(ParamsReader resource, ResourceParser<T> callback){
51+ ISceneCondition sc = GetConditionFor(resource);
52+ ParamsReader dnode = resource[VALUE_NODE];
53+ T _default = callback(dnode.IsNull ? resource : dnode);
54+#if DEBUG
55+ string indent_saved = debug_indent;
56+ debug_indent += " ";
57+ Debug.WriteLine(debug_indent+"value=" + _default);
58+#endif
59+ ParamsReader conds = resource[CONDITION_NODE];
60+ if (conds.IsNull) {
61+ return new SingleConditionResouce<T>(sc,_default);
62+ } else {
63+ NestedConditionsResouce<T> ret = new NestedConditionsResouce<T>(sc, _default);
64+#if DEBUG
65+ Debug.WriteLine(debug_indent + "+condition:" + ret);
66+#endif
67+ foreach (ParamsReader child in conds.Each) {
68+ ConditionedResource<T> temp = LoadChildConditions(child, callback);
69+ ret.AddChild(temp);
70+ }
71+#if DEBUG
72+ debug_indent = indent_saved;
73+#endif
74+ return ApplyOptimization<T>(ret);
75+ }
76+ }
77+
78+ private static ConditionedResource<T> ApplyOptimization<T>(NestedConditionsResouceRoot<T> orig) {
79+ return orig;
80+ }
81+
82+ private static ISceneCondition GetConditionFor(ParamsReader reader) {
83+ ISceneCondition sc = null;
84+ foreach (IConditionFactory cf in factories) {
85+ sc = cf.GetCondition(reader);
86+ if (sc != null) {
87+ Debug.WriteLine("");
88+ return sc;
89+ }
90+ }
91+ // find from primitive conditions.
92+ ParamsReader pr2 = reader[CONDITION_DESC_ATTR];
93+ if (pr2.IsNull) throw new PluginXmlException(reader, CONDITION_DESC_ATTR+" must be specified.");
94+ string attr = pr2.InnerText;
95+ sc = PrimitiveConditions.GetByName(attr);
96+ if (sc == null) {
97+ throw new PluginXmlException(reader, "Unresolved condition description : "+attr);
98+ }
99+ return sc;
100+ }
101+ #endregion
102+ }
103+}
--- trunk/core/core/view/ConditionedResource.cs (nonexistent)
+++ trunk/core/core/view/ConditionedResource.cs (revision 17)
@@ -0,0 +1,85 @@
1+using System;
2+using System.Collections.Generic;
3+using System.Text;
4+
5+namespace nft.core.view
6+{
7+ public class ConditionedResource<T>
8+ {
9+ internal protected T Default;
10+
11+ public ConditionedResource(T _default) {
12+ this.Default = _default;
13+ }
14+
15+ public T this[ISceneParams p] {
16+ get {
17+ T result = this.Default;
18+ Choose(p, ref result);
19+ return result;
20+ }
21+ }
22+
23+ internal protected virtual bool Choose(ISceneParams p, ref T res){
24+ res = Default;
25+ return true;
26+ }
27+ }
28+
29+ internal class SingleConditionResouce<T> : ConditionedResource<T>
30+ {
31+ protected readonly ISceneCondition Condition;
32+ internal SingleConditionResouce(ISceneCondition cond, T val) :base(val){
33+ this.Condition = cond;
34+ }
35+
36+ internal protected override bool Choose(ISceneParams p, ref T res) {
37+ if (Condition.IsMatch(p)) {
38+ res = Default;
39+ return true;
40+ } else {
41+ return false;
42+ }
43+ }
44+ }
45+
46+ internal class NestedConditionsResouceRoot<T> : ConditionedResource<T>
47+ {
48+ internal protected readonly List<ConditionedResource<T>> children;
49+ internal NestedConditionsResouceRoot(T val)
50+ : base(val) {
51+ this.children = new List<ConditionedResource<T>>();
52+ }
53+
54+ internal protected override bool Choose(ISceneParams p, ref T res) {
55+ foreach (ConditionedResource<T> cc in children) {
56+ if (cc.Choose(p, ref res)) {
57+ return true;
58+ }
59+ }
60+ res = Default;
61+ return true;
62+ }
63+
64+ public void AddChild(ConditionedResource<T> child) {
65+ children.Add(child);
66+ }
67+ }
68+
69+ internal class NestedConditionsResouce<T> : NestedConditionsResouceRoot<T>
70+ {
71+ internal protected readonly ISceneCondition Condition;
72+ internal NestedConditionsResouce(ISceneCondition cond, T val)
73+ : base(val) {
74+ this.Condition = cond;
75+ }
76+
77+ internal protected override bool Choose(ISceneParams p, ref T res) {
78+ if (Condition.IsMatch(p)) {
79+ return base.Choose(p, ref res);
80+ } else {
81+ return false;
82+ }
83+ }
84+ }
85+}
--- trunk/core/core/schedule/PrimitiveConditions.cs (revision 16)
+++ trunk/core/core/schedule/PrimitiveConditions.cs (revision 17)
@@ -85,9 +85,9 @@
8585 _until = AdjustType(_until, t);
8686 _from = AdjustType(_from, t);
8787 if (_until.CompareTo(_from) > 0) {
88- cond = new RangeCondition(groupname, name, ex, _from, _until);
88+ cond = new TimeRangeCondition(groupname, name, ex, _from, _until);
8989 } else {
90- cond = new BoudaryRangeCondition(groupname, name, ex, _from, _until);
90+ cond = new BoudaryTimeRangeCondition(groupname, name, ex, _from, _until);
9191 }
9292 }
9393 RegisterCondtion(cond);
@@ -110,9 +110,9 @@
110110 _until = AdjustType(_until, t);
111111 _from = AdjustType(_from, t);
112112 if (_until.CompareTo(_from) > 0) {
113- cond = new RangeCondition(groupname, name, ex, _from, _until);
113+ cond = new TimeRangeCondition(groupname, name, ex, _from, _until);
114114 } else {
115- cond = new BoudaryRangeCondition(groupname, name, ex, _from, _until);
115+ cond = new BoudaryTimeRangeCondition(groupname, name, ex, _from, _until);
116116 }
117117 }
118118 }
@@ -258,7 +258,7 @@
258258
259259 }
260260
261- public abstract class ComparebleSceneCondition : CacheableSceneCondition, IComparablesCondition {
261+ public abstract class ComparebleSceneCondition : CacheableSceneCondition {
262262 protected IConditionValueExtracter extracter;
263263
264264 protected ComparebleSceneCondition(string groupname, string name):base(groupname, name) {
@@ -273,16 +273,6 @@
273273 return extracter.ConditionType;
274274 }
275275 }
276-
277- #region IComparablesCondition implementation
278- public abstract IComparable From { get; }
279-
280- public virtual IComparable Until {
281- get {
282- return null;
283- }
284- }
285- #endregion
286276 }
287277
288278 public class EqualityCondition : ComparebleSceneCondition {
@@ -295,17 +285,39 @@
295285 protected override bool IsMatchCore(ISceneParams p) {
296286 return extracter.GetTestValue(p).CompareTo(match)==0;
297287 }
288+ }
298289
299- public override IComparable From {
300- get {
301- return match;
302- }
290+ public class TimeEqualityCondition : EqualityCondition, ITimeRangeCondition {
291+ public TimeEqualityCondition(string groupname, string name, IConditionValueExtracter ext, IComparable v)
292+ : base(groupname, name, ext, v) {
303293 }
294+
295+ #region ITimeRangeCondition implementation
296+ // These result are not cached
297+
298+ /// <summary>
299+ /// returns true if this condition is after the scene
300+ /// </summary>
301+ /// <param name="p"></param>
302+ /// <returns></returns>
303+ public bool IsAfter(ISceneParams p) {
304+ return extracter.GetTestValue(p).CompareTo(match) < 0;
305+ }
306+
307+ /// <summary>
308+ /// returns true if this condition is before the scene
309+ /// </summary>
310+ /// <param name="p"></param>
311+ /// <returns></returns>
312+ public bool IsBefore(ISceneParams p) {
313+ return extracter.GetTestValue(p).CompareTo(match) > 0;
314+ }
315+ #endregion
304316 }
305317
306- public class RangeCondition : ComparebleSceneCondition {
318+ public class TimeRangeCondition : ComparebleSceneCondition, ITimeRangeCondition {
307319 protected IComparable from, until;
308- public RangeCondition(string groupname, string name, IConditionValueExtracter ext, IComparable from, IComparable until)
320+ public TimeRangeCondition(string groupname, string name, IConditionValueExtracter ext, IComparable from, IComparable until)
309321 : base(groupname, name, ext) {
310322 this.from = from;
311323 this.until = until;
@@ -316,17 +328,27 @@
316328 return v.CompareTo(from) >= 0 && v.CompareTo(until) < 0; //from <= v && v < until;
317329 }
318330
319- public override IComparable From {
320- get {
321- return from;
322- }
331+ #region ITimeRangeCondition implementation
332+ // These result are not cached
333+
334+ /// <summary>
335+ /// returns true if this condition is after the scene
336+ /// </summary>
337+ /// <param name="p"></param>
338+ /// <returns></returns>
339+ public bool IsAfter(ISceneParams p) {
340+ return extracter.GetTestValue(p).CompareTo(from) < 0;
323341 }
324342
325- public override IComparable Until {
326- get {
327- return until;
328- }
343+ /// <summary>
344+ /// returns true if this condition is before the scene
345+ /// </summary>
346+ /// <param name="p"></param>
347+ /// <returns></returns>
348+ public bool IsBefore(ISceneParams p) {
349+ return extracter.GetTestValue(p).CompareTo(until) > 0;
329350 }
351+ #endregion
330352 }
331353
332354 /// <summary>
@@ -334,9 +356,9 @@
334356 /// For example, from at 23 o'clock to at 1 o'clock of the next day.
335357 /// This condition is given with arguments from=23, to=1.
336358 /// </summary>
337- public class BoudaryRangeCondition : ComparebleSceneCondition {
359+ public class BoudaryTimeRangeCondition : ComparebleSceneCondition, ITimeRangeCondition {
338360 protected IComparable from, until;
339- public BoudaryRangeCondition(string groupname, string name, IConditionValueExtracter ext, IComparable from, IComparable until)
361+ public BoudaryTimeRangeCondition(string groupname, string name, IConditionValueExtracter ext, IComparable from, IComparable until)
340362 : base(groupname, name, ext) {
341363 this.from = from;
342364 this.until = until;
@@ -347,17 +369,27 @@
347369 return v.CompareTo(until) < 0 || v.CompareTo(from) >= 0; //v < until || from <= v;
348370 }
349371
350- public override IComparable From {
351- get {
352- return from;
353- }
372+ #region ITimeRangeCondition implementation
373+ // These result are not cached
374+
375+ /// <summary>
376+ /// returns true if this condition is after the scene
377+ /// </summary>
378+ /// <param name="p"></param>
379+ /// <returns></returns>
380+ public bool IsAfter(ISceneParams p) {
381+ return extracter.GetTestValue(p).CompareTo(from) < 0;
354382 }
355383
356- public override IComparable Until {
357- get {
358- return until;
359- }
384+ /// <summary>
385+ /// returns true if this condition is before the scene
386+ /// </summary>
387+ /// <param name="p"></param>
388+ /// <returns></returns>
389+ public bool IsBefore(ISceneParams p) {
390+ return extracter.GetTestValue(p).CompareTo(until) > 0;
360391 }
392+ #endregion
361393 }
362394
363395 public class WeatherCondition : CacheableSceneCondition {