Finished gswe_moment_get_planet_aspects()

This commit is contained in:
Gergely Polonkai 2013-09-03 11:26:37 +02:00
parent dc94217a70
commit b954f0584e
2 changed files with 15 additions and 1 deletions

View File

@ -700,6 +700,19 @@ gswe_moment_get_aspects(GsweMoment *moment)
GList * GList *
gswe_moment_get_planet_aspects(GsweMoment *moment, GswePlanet planet) 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;
} }

View File

@ -118,6 +118,7 @@ guint gswe_moment_get_element_points(GsweMoment *moment, GsweElement element);
guint gswe_moment_get_quality_points(GsweMoment *moment, GsweQuality quality); guint gswe_moment_get_quality_points(GsweMoment *moment, GsweQuality quality);
GsweMoonPhaseData *gswe_moment_get_moon_phase(GsweMoment *moment); GsweMoonPhaseData *gswe_moment_get_moon_phase(GsweMoment *moment);
GList *gswe_moment_get_aspects(GsweMoment *moment); GList *gswe_moment_get_aspects(GsweMoment *moment);
GList *gswe_moment_get_planet_aspects(GsweMoment *moment, GswePlanet planet);
#endif /* __GSWE_MOMENT_H__ */ #endif /* __GSWE_MOMENT_H__ */