Exemple #1
0
static void gate_write(const trigger * t, struct storage *store)
{
  gate_data *gd = (gate_data *) t->data.v;
  building *b = gd->gate;
  region *r = gd->target;

  write_building_reference(b, store);
  write_region_reference(r, store);
}
Exemple #2
0
static void
object_write(const attrib * a, const void *owner, struct storage *store)
{
  const object_data *data = (object_data *) a->data.v;
  int type = (int)data->type;
  WRITE_TOK(store, data->name);
  WRITE_INT(store, type);
  switch (data->type) {
    case TINTEGER:
      WRITE_INT(store, data->data.i);
      break;
    case TREAL:
      WRITE_FLT(store, (float)data->data.real);
      break;
    case TSTRING:
      WRITE_STR(store, data->data.str);
      break;
    case TUNIT:
      write_unit_reference(data->data.u, store);
      break;
    case TFACTION:
      write_faction_reference(data->data.f, store);
      break;
    case TBUILDING:
      write_building_reference(data->data.b, store);
      break;
    case TSHIP:
      /* write_ship_reference(data->data.sh, store); */
      assert(!"not implemented");
      break;
    case TREGION:
      write_region_reference(data->data.r, store);
      break;
    case TNONE:
      break;
    default:
      assert(!"illegal type in object-attribute");
  }
}
Exemple #3
0
static void caldera_write(const trigger * t, struct storage *store)
{
  building *b = (building *) t->data.v;
  write_building_reference(b, store);
}
Exemple #4
0
static void wormhole_write(const struct attrib *a, const void *owner, struct storage *store)
{
    wormhole_data *data = (wormhole_data *)a->data.v;
    write_building_reference(data->entry, store);
    write_region_reference(data->exit, store);
}
Exemple #5
0
void a_writesiege(const attrib * a, const void *owner, struct storage *store)
{
  struct building *b = (struct building *)a->data.v;
  write_building_reference(b, store);
}
Exemple #6
0
static void unguard_write(const trigger * t, struct storage *store)
{
    write_building_reference((building *)t->data.v, store);
}