Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2004:
[Freeciv-Dev] Using turn_start_notify() agent callback
Home

[Freeciv-Dev] Using turn_start_notify() agent callback

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Using turn_start_notify() agent callback
From: "Guillermo Lopez Alejos" <100030179@xxxxxxxxxxxxxxx>
Date: Sat, 31 Jul 2004 20:55:19 +0200 (CEST)

Hi,

I'm trying to use the turn_start_notify() callback with puppeteer.

The puppeteer initialization is defined as :

void
puppeteer_init_as_agent(void)
{
  memset(&puppeteer_agent, 0, sizeof(puppeteer_agent));
  strcpy(puppeteer_agent.name, "Puppeteer");
  puppeteer_agent.level = 1;
  
  puppeteer_agent.turn_start_notify = exec_turn_start_notify;
  puppeteer_agent.unit_callbacks[CB_REMOVE] = exec_unit_remove;
  puppeteer_agent.unit_callbacks[CB_CHANGE] = exec_unit_change;
  puppeteer_agent.unit_callbacks[CB_NEW]    = exec_unit_new;
  puppeteer_agent.city_callbacks[CB_REMOVE] = exec_city_remove;
  puppeteer_agent.city_callbacks[CB_CHANGE] = exec_city_change;
  puppeteer_agent.city_callbacks[CB_NEW]    = exec_city_new;
  puppeteer_agent.tile_callbacks[CB_REMOVE] = exec_tile_remove;
  puppeteer_agent.tile_callbacks[CB_CHANGE] = exec_tile_change;
  puppeteer_agent.tile_callbacks[CB_NEW]    = exec_tile_new;
  register_agent(&puppeteer_agent);
}

The exec_turn_start_notify function is defined as:

void exec_turn_start_notify(void)
{
  freelog(LOG_NORMAL, "puppeteer: exec_turn_start_notify()");
  puppet_says("New turn!\n");
}

All the unit, city and tile callbacks work fine, but the
exec_turn_start_notify isn't called at turn start (I think it's never
called).

Perhaps I'm doing something wrong. Can anyone help me?

Thanks,

--
Guillermo López Alejos - N.I.A. 100030179
Universidad Carlos III de Madrid
Ingeniería Técnica en Informática de Gestión




[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] Using turn_start_notify() agent callback, Guillermo Lopez Alejos <=