/* * Date: 12/14/2005 * Time: 12:30 AM * * Copyright 2005, Static Boy Productions */ using System; using System.Drawing; namespace Jessie { /// /// A poll for all logics' VoteForActions are taken at the start of every turn that's available. The vote for the action with the heaviest weighting will "win" and steps will be taken to accomplish that goal. /// public class jtbvActionVote : IComparable { public string ActionName; public Point Location; public int Weight; public object[] Args; /// /// Creates a new jtbvActionVote with the parameters specified /// /// The name of the action to run. This corresponds to the title of the action in the "Actions" scripts collection. /// The location that the action should take place at. Note that this can be null if the action can take place anywhere. /// The weight that this vote should have. It's an integer without much scale -- the scale is determined by the logic programmer. Generally, something like 0 - 100 is a good idea. /// These are extra variables that may need to be passed into the action when it's performed (such as, the character handle of an item to dip into a fountain) public jtbvActionVote(string newActionName, Point newLocation, int newWeight, params object[] newArgs) { ActionName = newActionName; Location = newLocation; Weight = newWeight; Args = newArgs; } public int CompareTo(object obj) { jtbvActionVote vote = obj as jtbvActionVote; if (vote != null) { return (this.Weight - vote.Weight); } return (-1); } } }