Пример #1
0
 public ActionEventArgs(Person doer, Person target, Prop prop, object data = null)
 {
     this.Doer = doer;
     this.Target = target;
     this.Prop = prop;
     this.Data = data;
     this.Stage = ActionStages.Passive;
 }
Пример #2
0
 public Prop CreateProp(string name)
 {
     Prop newProp = new Prop();
     newProp.Template = this.GetPropTemplate(name);
     newProp.Image = newProp.Template.Image;
     newProp.MaxOccupancy = newProp.Template.MaxOccupancy;
     return newProp;
 }
Пример #3
0
 public Uri GetPropImage(Prop prop)
 {
     return new Uri(prop.Template.Source.Directory + @"\Props\Images\" + prop.Image);
 }
Пример #4
0
 protected void PlaceProp(GameEntity target, Prop prop)
 {
     this.Agent.Inventory.Remove(prop);
     target.Inventory.Add(prop);
 }
Пример #5
0
        protected GameAction UseProp(Prop prop)
        {
            GameAction action = null;

            if (prop != null && prop.Template.Actions.Count > 0)
            {
                action = GameAction.Get(MiscUtilities.GetRandomEntry<string>(prop.Template.Actions));

                action.Perform(new ActionEventArgs(this.Agent, null, prop));
            }

            return action;
        }