-
Notifications
You must be signed in to change notification settings - Fork 89
Scene Class
Komefai edited this page Jan 7, 2018
·
8 revisions
Scene is the base class for all scenes.
public abstract class Scene
class MissionSelect : Scene
{
public override string Name => "Mission Select";
public static RectMap RandomMission = new RectMap
{
ID = "MissionSelect|RandomMission",
Hash = 179719840936639549,
X = 166,
Y = 179,
Width = 219,
Height = 118
};
public static PixelMap ReplaySelected = new PixelMap
{
ID = "MissionSelect|ReplaySelected",
X = 387,
Y = 445,
Color = 0xFFFFFF
};
public override bool Match(ScriptBase script)
{
return script.MatchTemplate(RandomMission, 92);
}
public override void OnMatched(ScriptBase script)
{
var _script = script as MainScript;
if (_script.ShouldMove && !script.MatchTemplate(ReplaceSelected))
{
script.Press(new DualShockState() { DPad_Up = true }, 100);
}
script.Sleep(1000);
script.Press(new DualShockState() { Cross = true }, 250);
}
}
You should override these properties.
abstract public string Name { get; }
Name of the scene.
You should override these methods.
abstract public bool Match(ScriptBase script);
Test a condition to match this scene.
abstract public void OnMatched(ScriptBase script);
Called when the scene is matched.
public static Scene Search(ScriptBase script)
Sort by search priority (frequent scenes first). This method will go through the Script's Config.Scenes
list in order and call Match() until a match is found.