-
Notifications
You must be signed in to change notification settings - Fork 0
/
mundo.h
1471 lines (1267 loc) · 38.5 KB
/
mundo.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/**
* @brief Utilidades para crear y modificar el mundo
*
* Este modulo contiene los prototipos de las funciones para todas las acciones posibles respecto al mundo
*
* @file mundo.h
* @author Carlos Carrascal, Antonio Jiménez y Miguel Gordo
* @version 1.0
* @date 02-11-2010
*/
#include "jugador.h"
#include "espacio.h"
#include "objeto.h"
#include "union.h"
#ifndef _MUNDO_H
#define _MUNDO_H
/**
* @brief Estructura básica de un mundo
*
* Esta estructura contiene todos los espacios, jugadores y objetos de un mundo
*/
typedef struct
{
ESPACIO ** espacios; /*!< Puntero a un array de punteros a ESPACIO's*/
OBJETO ** objetos;/*!< Puntero a un array de punteros a OBJETO's*/
JUGADOR ** jugador;/*!< Puntero a un array de punteros a JUGADOR'es*/
UNION ** uniones;/*!< Puntero a un array de punteros a UNION'es*/
int numesp;/*!< Numero que indica la cantidad de ESPACIO's del MUNDO*/
int numobj;/*!< Numero que indica la cantidad de OBJETO's del MUNDO*/
int numjug;/*!< Numero que indica la cantidad de JUGADOR'es del MUNDO*/
int numuni;/*!< Numero que indica la cantidad de UNION'es del MUNDO*/
} MUNDO;
/***************************************/
/**Funciones básicas del mundo***********/
/***************************************/
/**
* @brief crea un mundo
*
* nuevoMundo() reserva memoria para un mundo completo
*
* @param numesp es el numero de espacios a reservar
* @param numobj es el numero de objetos a reservar
* @param numjug es el numero de personajes a reservar
* @param numuni es el numero de uniones a reservar
*
* @return un puntero al nuevo mundo creado, o NULL si dió error
*/
MUNDO * nuevoMundo(int numesp, int numobj, int numjug, int numuni);
/**
* @brief Libera un mundo completo
*
* destruyeMundo() recorre toda la estructura liberando todos los objetos, espacios y jugadores
*
* @param m es un puntero de un puntero al mundo
*
* @return no tiene devolucion
*/
void destruyeMundo(MUNDO ** m);
/**
* @brief informa del numero de jugadores
/**
* saberNumJug() accede a la estructura y guarda en num lo pedido
/**
* @param m es un puntero al mundo
* @param num es un puntero a un entero
/**
* @return OK si fue correcto, ERR si fallo
/***/
STATUS saberNumJug(MUNDO *m, int *num);
/**
* @brief informa del numero de objetos
/**
* saberNumObj() accede a la estructura y guarda en num lo pedido
/**
* @param m es un puntero al mundo
* @param num es un puntero a un entero
/**
* @return OK si fue correcto, ERR si fallo
/***/
STATUS saberNumObj(MUNDO *m, int *num);
/**
* @brief informa del numero de espacios
/**
* saberNumEsp() accede a la estructura y guarda en num lo pedido
/**
* @param m es un puntero al mundo
* @param num es un puntero a un entero
/**
* @return OK si fue correcto, ERR si fallo
/***/
STATUS saberNumEsp(MUNDO *m, int *num);
/**
* @brief informa del numero de uniones
/**
* saberNumUni() accede a la estructura y guarda en num lo pedido
/**
* @param m es un puntero al mundo
* @param num es un puntero a un entero
/**
* @return OK si fue correcto, ERR si fallo
/***/
STATUS saberNumUni(MUNDO *m, int *num);
/***************************************/
/**Funciones básicas para crear objetos**/
/***************************************/
/**
* @brief Guarda un objeto en el mundo
/**
* guardaObj() guarda en la primera posicion libre el elemento recibido
/**
* @param m es un puntero al mundo
* @param objeto es un puntero al objeto a guardar
/**
* @return OK si fue correcto, ERR si fallo
/***/
STATUS guardaObj(MUNDO *m, OBJETO * objeto);
/**
* @brief crea un objeto
/**
* creaObj() reserva la memoria
/**
* @param objeto es un puntero a un puntero tipo objeto
/**
* @return OK si fue correcto, ERR si fallo
/***/
STATUS creaObj(OBJETO ** objeto);
/**
* @brief Destruye un objeto
/**
* destruyeObj() elimina la reserva de memoria
/**
* @param objeto es un puntero a un puntero tipo objeto
/**
* @return OK si fue correcto, ERR si fallo
/***/
STATUS destruyeObj(OBJETO ** objeto);
/**
* @brief Modifica la id de un objeto
/**
* creaIdObjMundo() modifica la id de cierto objeto
/**
* @param objeto es un puntero al objeto
* @param id es la id a guardar
/**
* @return OK si fue correcto, ERR si fallo
/***/
STATUS creaIdObjMundo(OBJETO * objeto, ID id);
/**
* @brief Modifica el nombre de un objeto
/**
* creaNombreObj() guarda como nombre la cadena nombre
/**
* @param objeto es un puntero al objeto
* @param nombre es un puntero a la cadena con los datos
/**
* @return OK si fue correcto, ERR si fallo
/***/
STATUS creaNombreObj(OBJETO * objeto, char * nombre);
/**
* @brief Modifica la descripcion de un objeto
/**
* creaDescObj() guarda como descripcion la cadena descripcion
/**
* @param objeto es un puntero al objeto
* @param descripcion es un puntero a la cadena con los datos
/**
* @return OK si fue correcto, ERR si fallo
/***/
STATUS creaDescObj(OBJETO * objeto, char *descripcion);
/**
* @brief Modifica la descripcion de un objeto movido
/**
* creaDescMovidoObj() guarda como descripcion secundaria a la cadena descMovido
/**
* @param objeto es un puntero al objeto
* @param descMovido es un puntero a la cadena con los datos
/**
* @return OK si fue correcto, ERR si fallo
/***/
STATUS creaDescMovidoObj(OBJETO * objeto, char * descMovido);
/**
* @brief Modifica el examinado de un objeto
/**
* creaExamObj() guarda como examinado a la cadena examinar
/**
* @param objeto es un puntero al objeto
* @param examinar un puntero a la cadena con los datos
/**
* @return OK si fue correcto, ERR si fallo
/***/
STATUS creaExamObj(OBJETO * objeto, char * examinar);
/**
* @brief Establece si un objeto se puede mover o no
/**
* creaMovilObj() pone en TRUE o FALSE la indicacion movil
/**
* @param objeto es un puntero al objeto
* @param movil es un booleano que indica si se mueve o no
/**
* @return OK si fue correcto, ERR si fallo
/***/
STATUS creaMovilObj(OBJETO * objeto, BOOL movil);
/**
* @brief Establece si un objeto ha sido movido o no
/**
* creaMovidoObj() pone a TRUE o FALSE la indicacion movido
/**
* @param objeto es un puntero al objeto
* @param movido es un booleano que indica si se movio o no
/**
* @return OK si fue correcto, ERR si fallo
/***/
STATUS creaMovidoObj(OBJETO * objeto,BOOL movido);
/**
* @brief Establece si un objeto esta oculto o no
/**
* creaOcultoObj() pone a TRUE o FALSE la indicacion oculto
/**
* @param objeto es un puntero al objeto
* @param oculto es un booleano que indica si esta oculto o no
/**
* @return OK si fue correcto, ERR si fallo
/***/
STATUS creaOcultoObj(OBJETO * objeto, BOOL oculto);
/**
* @brief Establece si un objeto esta encendido o no
/**
* creaEncendidoObj() pone a TRUE o FALSE la indicacion encendido
/**
* @param objeto es un puntero al objeto
* @param encendido es un booleano que indica si esta encendido o no
/**
* @return OK si fue correcto, ERR si fallo
/***/
STATUS creaEncendidoObj(OBJETO * objeto, BOOL encendido);
/**
* @brief Establece si un objeto es contenedor o no
/**
* creaContenedorObj() pone a TRUE o FALSE la indicacion contenedor
/**
* @param objeto es un puntero al objeto
* @param contenedor es un booleano que indica si puede contener o no
/**
* @return OK si fue correcto, ERR si fallo
/***/
STATUS creaContenedorObj(OBJETO * objeto, BOOL contenedor);
/**
* @brief Establece si un objeto se puede encender o no
/**
* creaLuzObj() pone a TRUE o FALSE la indicacion luz
/**
* @param objeto es un puntero al objeto
* @param luz es un booleano que indica si se puede encender o no
/**
* @return OK si fue correcto, ERR si fallo
/***/
STATUS creaLuzObj(OBJETO * objeto, BOOL luz);
/***************************************/
/**Funciones para objeto*****************/
/***************************************/
/**
* @brief devuelve el objeto sabiendo la id
/**
* dameObjeto() devuelve un puntero a un objeto sabiendo la id
/**
* @param m es un puntero al mundo
* @param id es el identificador a buscar
*
* @return un puntero al objeto o NULL si falló
/***/
OBJETO * dameObjeto(MUNDO * m, ID id);
/**
* @brief consigues el objeto sabiendo el nombre
/**
* consigueObjeto() devuelve un puntero a un objeto cuyo nombre coincide con uno dado
/**
* @param m es un puntero al mundo
* @param nombre es un puntero a la cadena donde está el nombre buscado
/**
* @return un puntero al objeto encontrado o NULL si dió error
/***/
OBJETO * consigueObjeto(MUNDO * m, char * nombre);
/**
* @brief devuelve el nombre de un objeto
/**
* darNombreObj() devuelve en una cadena dada el nombre de un objeto teniendo su puntero
/**
* @param objeto es un puntero al objeto deseado
* @param nombre es un puntero al array donde guardar dicho nombre
/**
* @return ERR si se produjo error,OK si se hizo correctamente
/***/
STATUS darNombreObj(OBJETO * objeto, char *nombre);
/**
* @brief devuelve el espacio donde se encuentra un objeto
/**
* darLocObj() devuelve la id del espacio donde se encuentra un objeto teniendo el puntero de este
/**
* @param m es un puntero al mundo
* @param objeto es un puntero al objeto deseado
/**
* @return devuelve la id del espacio buscado
/***/
ID darLocObj(MUNDO *m, OBJETO * objeto);
/**
* @brief devuelve la descripcion inicial de un objeto
/**
* dameDescrObj() guarda en una cadena la descripcion de un objeto siempre que no supere el tamaño
/**
* @param objeto es un puntero al objeto deseado
* @param descripcion es un puntero a una cadena donde guardar la descripcion pedida
* @param max_len es el tamaño de descripcion
/**
* @return OK si todo es correcto, ERR si hubo algun fallo
/***/
STATUS dameDescrObj(OBJETO * objeto, char *descripcion, int max_len);
/**
* @brief mete un objeto en otro
/**
* meteObjObj() almacena en el inventario de un objeto a otro objeto
/**
* @param objeto es un puntero al objeto que guarda
* @param id es la id del objeto a guardar
/**
* @return OK si todo es correcto, ERR si hubo algun fallo
/***/
STATUS meterObjObj(OBJETO *objeto, ID id);
/**
* @brief devuelve la descripcion al examinar un objeto
/**
* darDescrexamObj() guarda en una cadena la descripcion de un objeto siempre que no supere el tamaño
/**
* @param o es un puntero al objeto deseado
* @param descripcion es un puntero a una cadena donde guardar la descripcion pedida
* @param max_len es el tamaño de descripcion
/**
* @return OK si todo es correcto, ERR si hubo algun fallo
/***/
STATUS darDescrexamObj(OBJETO * o, char *descripcion, int max_len);
/**
* @brief devuelve la descripcion inicial de un objeto
/**
* darDescrObj() guarda en una cadena la descripcion de un objeto siempre que no supere el tamaño
/**
* @param objeto es un puntero al objeto deseado
* @param descripcion es un puntero a una cadena donde guardar la descripcion pedida
* @param max_len es el tamaño de descripcion
/**
* @return OK si todo es correcto, ERR si hubo algun fallo
/***/
STATUS darDescrObj(OBJETO * objeto, char *descripcion, int max_len);
/**
* @brief devuelve la descripcion de un objeto movido
/**
* darDescrMovidoObj() guarda en una cadena la descripcion de un objeto movido siempre que no supere el tamaño
/**
* @param objeto es un puntero al objeto deseado
* @param descripcion es un puntero a una cadena donde guardar la descripcion pedida
* @param max_len es el tamaño de descripcion
/**
* @return OK si todo es correcto, ERR si hubo algun fallo
/***/
STATUS darDescrMovidoObj(OBJETO * objeto, char *descripcion, int max_len);
/**
* @brief devuelve la id de un objeto
/**
* darIdObj() devuelve la id del un objeto teniendo el puntero a este
/**
* @param o es un puntero al objeto deseado
/**
* @return devuelve la id del espacio buscado o menor que cero si es error
/***/
ID darIdObj(OBJETO * o);
/**
* @brief informa si un objeto es movil
/**
* darMovilObj() accede al campo movil de un objeto
/**
* @param o es un puntero al objeto deseado
/**
* @return TRUE o FALSE dependiendo del objeto
/***/
BOOL darMovilObj(OBJETO * o);
/**
* @brief informa si un objeto ha sido movido
/**
* darMovidoObj() accede al campo movido de un objeto
/**
* @param o es un puntero al objeto deseado
/**
* @return TRUE o FALSE dependiendo del objeto
/***/
BOOL darMovidoObj(OBJETO * o);
/**
* @brief informa si un objeto es oculto
/**
* darOcultoObj() accede al campo oculto de un objeto
/**
* @param o es un puntero al objeto deseado
/**
* @return TRUE o FALSE dependiendo del objeto
/***/
BOOL darOcultoObj(OBJETO * o);
/**
* @brief informa si un objeto esta encendido
/**
* darEncendidoObj() accede al campo encendido de un objeto
/**
* @param o es un puntero al objeto deseado
/**
* @return TRUE o FALSE dependiendo del objeto
/***/
BOOL darEncendidoObj(OBJETO * o);
/**
* @brief informa si un objeto se puede encender
/**
* darLuzObj() accede al campo luz de un objeto
/**
* @param o es un puntero al objeto deseado
/**
* @return TRUE o FALSE dependiendo del objeto
/***/
BOOL darLuzObj(OBJETO * o);
/**
* @brief informa si un objeto es contenedor
/**
* darContenedorObj() accede al campo contenedor de un objeto
/**
* @param o es un puntero al objeto deseado
/**
* @return TRUE o FALSE dependiendo del objeto
/***/
BOOL darContenedorObj(OBJETO * o);
/**
* @brief informa si un objeto esta en otro objetor
/**
* isObjInObjMun() informa si un objeto, dada su id, esta dentro de un objeto del cual tenemos su puntero
/**
* @param o es un puntero al objeto contenedor
* @param id es la id del objeto contenido
/**
* @return TRUE o FALSE dependiendo del objeto
/***/
BOOL isObjInObjMun(OBJETO * o, ID id);
/**
* @brief sacamos un objeto de otro
/**
* sacaObjOfObj() extrae una id del inventario de otro objeto dado
/**
* @param cont es un puntero al objeto contenedor
* @param obj es la id del objeto contenido
/**
* @return OK si todo fue correcto, ERR en caso contario
/***/
STATUS sacaObjOfObj(OBJETO *cont, ID obj);
/****************************************/
/**Funciones básicas para crear un jugador/
/****************************************/
/**
* @brief Guarda un jugador en el mundo
/**
* guardaJug() guarda en la primera posicion libre el elemento recibido
/**
* @param m es un puntero al mundo
* @param jugador es un puntero al jugador a guardar
/**
* @return OK si fue correcto, ERR si fallo
/***/
STATUS guardaJug(MUNDO *m, JUGADOR * jugador);
/**
* @brief crea un jugador
/**
* creaJug() reserva la memoria
/**
* @param jugador es un puntero a un puntero tipo jugador
/**
* @return OK si fue correcto, ERR si fallo
/***/
STATUS creaJug(JUGADOR ** jugador);
/**
* @brief Destruye un jugador
/**
* destruyeJug() elimina la reserva de memoria
/**
* @param jugador es un puntero a un puntero tipo jugador
/**
* @return OK si fue correcto, ERR si fallo
/***/
STATUS destruyeJug(JUGADOR ** jugador);
/**
* @brief Modifica la id de un jugador
/**
* creaIdJug() modifica la id de un jugador dado
/**
* @param jugador es un puntero al jugador
* @param id es la id a guardar
/**
* @return OK si fue correcto, ERR si fallo
/***/
STATUS creaIdJug(JUGADOR * jugador, ID id);
/**
* @brief Modifica el nombre de un jugador
/**
* creaNombreJug() guarda como nombre la cadena nombre
/**
* @param jugador es un puntero al jugador
* @param nombre es un puntero a la cadena con la informacion
/**
* @return OK si fue correcto, ERR si fallo
/***/
STATUS creaNombreJug(JUGADOR * jugador, char * nombre);
/**
* @brief Modifica la posicion de un jugador
/**
* creaLocJug() modifica la id de la posicion de un jugador dado
/**
* @param jugador es un puntero al jugador
* @param id es la id a guardar
/**
* @return OK si fue correcto, ERR si fallo
/***/
STATUS creaLocJug(JUGADOR * jugador, ID id);
/**
* @brief Modifica el tamaño del inventario de un jugador
/**
* creaMaxObjJug() cambia el tamaño de un inventario
/**
* @param jugador es un puntero al jugador
* @param max es un entero con el tamaño deseado
/**
* @return OK si fue correcto, ERR si fallo
/***/
STATUS creaMaxObjJug(JUGADOR * jugador, int max);
/**
* @brief introduce un objeto en un inventario de un jugador
/**
* meteObjJug() guarda en el inventario de del jugador un objeto
/**
* @param jugador es un puntero al jugador donde guardar
* @param id es la id del objeto a guardar
/**
* @return OK si fue correcto, ERR si falló
/***/
STATUS meteObjJug(JUGADOR *jugador, ID id);
/***************************************/
/**Funciones para jugador****************/
/***************************************/
/**
* @brief devuelve el jugador sabiendo la id
/**
* dameJugador() devuelve un puntero a un jugador sabiendo la id
/**
* @param m es un puntero al mundo
* @param id es el identificador a buscar
*
* @return un puntero al jugador o NULL si falló
/***/
JUGADOR * dameJugador(MUNDO * m, ID id);
/**
* @brief devuelve el nombre de un jugador
/**
* darNombreJug() devuelve en una cadena dada el nombre de un jugador teniendo su puntero
/**
* @param jugador es un puntero al jugador deseado
* @param nombre es un puntero al array donde guardar dicho nombre
* @param max_len es el tamaño de nombre
/**
* @return ERR si se produjo error,OK si se hizo correctamente
/***/
STATUS darNombreJug(JUGADOR *jugador, char *nombre, int max_len);
/**
* @brief devuelve la localizacion de un jugador
/**
* darLocJug() devuelve la id del espacio donde se situa
/**
* @param jugador es un puntero al jugador deseado
/**
* @return la ID del espacio
/***/
ID darLocJug(JUGADOR * jugador);
/**
* @brief consigues el jugador sabiendo el nombre
/**
* consigueJugador() devuelve un puntero a un jugador cuyo nombre coincide con uno dado
/**
* @param m es un puntero al mundo
* @param nombre es un puntero a la cadena donde está el nombre buscado
/**
* @return un puntero al objeto encontrado o NULL si dió error
/***/
JUGADOR * consigueJugador(MUNDO * m, char * nombre);
/**
* @brief informa sobre el inventario de un jugador
/**
* dameInvExaminar() devuelve dentro de info una cadena con los nombres de los objetos del inventario
/**
* @param m es un puntero al mundo
* @param jug es un puntero al jugador deseado
* @param info es un puntero a la cadena donde guardar los datos
/**
* @return ERR si se produjo error,OK si se hizo correctamente
/***/
STATUS dameInvExaminar(MUNDO *m, JUGADOR * jug, char * info);
/**
* @brief informa sobre la id de un jugador
/**
* darIdJug() devuelve el identificador de un jugador
/**
* @param j es un puntero al jugador deseado
/**
* @return una ID que sera negativa en caso de error
/***/
ID darIdJug(JUGADOR * j);
/**
* @brief informa sobre el inventario de un jugador
/**
* darMaxJug() devuelve el tamaño del inventario de un jugador
/**
* @param j es un puntero al jugador deseado
/**
* @return un entero con el tamaño
/***/
int darMaxJug(JUGADOR * j);
/**
* @brief informa si cierto objeto lo tiene un jugador
/**
* isObjInInvMun() devuelve un booleano diciendo si un objeto se situa dentro del inventario de un jugador
/**
* @param j es un puntero al jugador deseado
* @param id es la id del objeto a buscar
/**
* @return un booleano que indiqui TRUE o FALSE
/***/
BOOL isObjInInvMun(JUGADOR * j, ID id);
/**
* @brief extrae un objeto del inventario de un jugador
/**
* sacaObjOfInv() extrae la id de un objeto del conjunto que forma el inventario de un jugador
/**
* @param cont es un puntero al jugador deseado
* @param obj es la id del objeto a extraer
/**
* @return ERR si se produjo error,OK si se hizo correctamente
/***/
STATUS sacaObjOfInv(JUGADOR *cont, ID obj);
/***************************************/
/**Funciones básicas para crear espacios*/
/***************************************/
/**
* @brief Guarda un espacio en el mundo
/**
* guardaEsp() guarda en la primera posicion libre el elemento recibido
/**
* @param m es un puntero al mundo
* @param espacio es un puntero al espacio a guardar
/**
* @return OK si fue correcto, ERR si fallo
/***/
STATUS guardaEsp(MUNDO *m, ESPACIO * espacio);
/**
* @brief crea un espacio
/**
* creaEsp() reserva la memoria necesaria
/**
* @param espacio es un puntero a un puntero tipo espacio
/**
* @return OK si fue correcto, ERR si fallo
/***/
STATUS creaEsp(ESPACIO ** espacio);
/**
* @brief creaDescGraficaEsp
* Esta función permite cambiar la descripción gráfica de un espacio
* @param espacio es puntero al espacio en el que guardar la desscripción gráfica
* @param dibujo es puntero de char con la descripción gráfica a guardar
* @param filas es entero con el número de filas de la descripción gráfica
* @param columnas es entero con el número de columnas de la descripción gráfica
* @return ERR si no se introdujo correctamente o OK en caso contrario
* @author Miguel Gordo
*/
STATUS creaDescrGraficaEsp(ESPACIO *espacio,char *dibujo,int filas,int columnas);
/**
* @brief Destruye un espacio
/**
* destruyeEsp() elimina la reserva de memoria
/**
* @param espacio es un puntero a un puntero tipo espacio
/**
* @return OK si fue correcto, ERR si fallo
/***/
STATUS destruyeEsp(ESPACIO ** espacio);
/**
* @brief Modifica la id de un espacio
/**
* creaIdEspMundo() modifica la id de cierto espacio
/**
* @param espacio es un puntero al espacio
* @param id es la id a guardar
/**
* @return OK si fue correcto, ERR si fallo
/***/
STATUS creaIdEspMundo(ESPACIO * espacio, ID id);
/**
* @brief Modifica la descripcion de un espacio
/**
* creaDescEsp() guarda como descripcion la cadena descripcion
/**
* @param espacio es un puntero al espacio
* @param descripcion es un puntero a la cadena con los datos
/**
* @return OK si fue correcto, ERR si fallo
/***/
STATUS creaDescEsp(ESPACIO * espacio, char *descripcion);
/**
* @brief Modifica el examinado de un espacio
/**
* creaExamEsp() guarda como examinado a la cadena examinar
/**
* @param espacio es un puntero al espacio
* @param examinar un puntero a la cadena con los datos
/**
* @return OK si fue correcto, ERR si fallo
/***/
STATUS creaExamEsp(ESPACIO * espacio, char * examinar);
/**
* @brief introduce un objeto en un espacio
/**
* meteObjEsp() guarda en el inventario del espacio un objeto
/**
* @param espacio es un puntero al espacio donde guardar
* @param id es la id del objeto a guardar
/**
* @return OK si fue correcto, ERR si falló
/***/
STATUS meteObjEsp(ESPACIO * espacio, ID id);
/**
* @brief Establece si un espacio es luminoso o no
/**
* creaLumEsp() pone en TRUE o FALSE la indicacion luminoso
/**
* @param espacio es un puntero al espacio
* @param luminoso es un booleano que indica si es luminoso o no
/**
* @return OK si fue correcto, ERR si fallo
/***/
STATUS creaLumEsp(ESPACIO *espacio, BOOL luminoso);
/**
* @brief Establece la posible union al norte de un espacio
/**
* creaNorteEsp() indica la ID de la union norte si existiera
/**
* @param espacio es un puntero al espacio
* @param id es la id de la union si acaso esta existe
/**
* @return OK si fue correcto, ERR si fallo
/***/
STATUS creaNorteEsp(ESPACIO * espacio, ID id);
/**
* @brief Establece la posible union al sur de un espacio
/**
* creaSurEsp() indica la ID de la union sur si existiera
/**
* @param espacio es un puntero al espacio
* @param id es la id de la union si acaso esta existe
/**
* @return OK si fue correcto, ERR si fallo
/***/
STATUS creaSurEsp(ESPACIO * espacio, ID id);
/**
* @brief Establece la posible union al este de un espacio
/**
* creaEsteEsp() indica la ID de la union este si existiera
/**
* @param espacio es un puntero al espacio
* @param id es la id de la union si acaso esta existe
/**
* @return OK si fue correcto, ERR si fallo
/***/
STATUS creaEsteEsp(ESPACIO * espacio, ID id);
/**
* @brief Establece la posible union al oeste de un espacio
/**
* creaOesteEsp() indica la ID de la union oeste si existiera
/**
* @param espacio es un puntero al espacio
* @param id es la id de la union si acaso esta existe
/**
* @return OK si fue correcto, ERR si fallo
/***/
STATUS creaOesteEsp(ESPACIO * espacio, ID id);
/**
* @brief Establece la posible union encima de un espacio
/**
* creaArribaEsp() indica la ID de la union arriba si existiera
/**
* @param espacio es un puntero al espacio
* @param id es la id de la union si acaso esta existe
/**
* @return OK si fue correcto, ERR si fallo
/***/
STATUS creaArribaEsp(ESPACIO * espacio, ID id);
/**
* @brief Establece la posible union debajo de un espacio
/**
* creaAbajoEsp() indica la ID de la union abajo si existiera
/**
* @param espacio es un puntero al espacio
* @param id es la id de la union si acaso esta existe
/**
* @return OK si fue correcto, ERR si fallo
/***/
STATUS creaAbajoEsp(ESPACIO * espacio, ID id);
/***************************************/
/**Funciones para espacio****************/
/***************************************/
/**
* @brief devuelve la descripcionde un espacio
/**
* dameDescrEsp() guarda en una cadena la descripcion de un espacio siempre que no supere el tamaño
/**
* @param espacio es un puntero al espacio deseado
* @param descripcion es un puntero a una cadena donde guardar la descripcion pedida
* @param max_len es el tamaño de descripcion
/**
* @return OK si todo es correcto, ERR si hubo algun fallo
/***/
STATUS darDescrEsp(ESPACIO * espacio, char *descripcion, int max_len);
/**
* @brief devuelve la descripcion grafica de un espacio
/**
* darDescrGraficaEsp() guarda en una cadena la descripcion grafica de un espacio y los tamaños
/**
* @param e es un puntero al espacio deseado
* @param descripcion es un triple puntero a char donde guardar la descripcion grafica pedida
* @param filas es donde guardar el tamaño de las filas
* @param columnas es donde guardar el tamaño de las columnas
/**
* @return OK si todo es correcto, ERR si hubo algun fallo
/***/
STATUS darDescrGraficaEsp(ESPACIO * e, char ***descripcion, int * filas, int * columnas);
/**
* @brief devuelve el espacio sabiendo la id
/**
* dameEspacio() devuelve un puntero a un espacio sabiendo la id
/**
* @param m es un puntero al mundo
* @param id es el identificador a buscar
*
* @return un puntero al espacio o NULL si falló
/***/
ESPACIO * dameEspacio(MUNDO * m, ID id);
/**
* @brief informa sobre la id de un espacio
/**
* darIdEsp() devuelve el identificador de un espacio
/**
* @param e es un puntero al espacio deseado
/**
* @return una ID que sera negativa en caso de error
/***/
ID darIdEsp(ESPACIO *e);
/**