From c8ea47fbc043ce7cbf374bb7efe9a060e52ee52b Mon Sep 17 00:00:00 2001 From: "Gergely POLONKAI (W00d5t0ck)" Date: Tue, 3 Sep 2013 11:26:37 +0200 Subject: [PATCH] (split from Astrognome)Finished gswe_moment_get_planet_aspects() --- src/gswe-moment.c | 15 ++++++++++++++- src/gswe-moment.h | 1 + 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/gswe-moment.c b/src/gswe-moment.c index feae7a4..9abdebf 100644 --- a/src/gswe-moment.c +++ b/src/gswe-moment.c @@ -700,6 +700,19 @@ gswe_moment_get_aspects(GsweMoment *moment) GList * gswe_moment_get_planet_aspects(GsweMoment *moment, GswePlanet planet) { - return NULL; + GList *ret = NULL, + *aspect; + + gswe_moment_calculate_aspects(moment); + + for (aspect = moment->priv->aspect_list; aspect; aspect = aspect->next) { + GsweAspectData *aspect_data = aspect->data; + + if ((aspect_data->planet1->planet_id == planet) || (aspect_data->planet2->planet_id == planet)) { + ret = g_list_prepend(ret, aspect_data); + } + } + + return ret; } diff --git a/src/gswe-moment.h b/src/gswe-moment.h index 0ff732d..7cc104d 100644 --- a/src/gswe-moment.h +++ b/src/gswe-moment.h @@ -118,6 +118,7 @@ guint gswe_moment_get_element_points(GsweMoment *moment, GsweElement element); guint gswe_moment_get_quality_points(GsweMoment *moment, GsweQuality quality); GsweMoonPhaseData *gswe_moment_get_moon_phase(GsweMoment *moment); GList *gswe_moment_get_aspects(GsweMoment *moment); +GList *gswe_moment_get_planet_aspects(GsweMoment *moment, GswePlanet planet); #endif /* __GSWE_MOMENT_H__ */