/// <summary> /// Adds prop to place. /// </summary> /// <param name="prop"></param> /// <param name="positionType"></param> public void AddProp(DungeonProp prop, Placement positionType) { this.Puzzle.AddProp(this, prop, positionType); }
/// <summary> /// Adds prop to puzzle in place. /// </summary> /// <param name="place"></param> /// <param name="prop"></param> /// <param name="positionType"></param> public void AddProp(PuzzlePlace place, DungeonProp prop, Placement positionType) { if (this.Region == null) throw new PuzzleException("AddProp outside of OnPuzzleCreate."); var pos = place.GetPosition(positionType); prop.RegionId = this.Region.Id; prop.Info.X = pos[0]; prop.Info.Y = pos[1]; prop.UpdateShapes(); prop.Info.Direction = MabiMath.DegreeToRadian(pos[2]); prop.Behavior += PuzzleEvent; this.Region.AddProp(prop); this.Props[prop.Name] = prop; }