Defines | Functions | Variables

corns_configs.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "corns_configs.h"
#include "robodim.h"
#include <ul_log.h>
Include dependency graph for corns_configs.c:

Defines

#define STRING_LENGTH   64
#define POSITION_DIMENSION   2
#define FIRST_CORN_X_OFFSET_M   0.15
 CORNS GRID CONSTANTS.
#define FIRST_CORN_Y_OFFSET_M   0.128
#define CORNS_X_SPACING_M   0.45
#define CORNS_Y_SPACING_M   0.25

Functions

 UL_LOG_CUST (ulogd_corns_configs)
char * position_indexes_to_string (const int position[POSITION_DIMENSION])
char * position_to_string (struct position *position)
void print_positions_indexes (int **positions)
void print_corn_position (struct corn *corn)
 Print corns int corns_group structure pointed to by given argument.
void print_corns_positions (struct corns_group *corns_group)
 Print all description of all corns in the corns_group structure pointed to by given argument.
void copy_corn_indexes (const int from_position[POSITION_DIMENSION], int *to_position)
 FIXME prepoklada pole o delce 2.
void copy_corns_indexes (const int from_array[][POSITION_DIMENSION], int **to_array, int from_start_index, int to_start_index, int count)
void mirror_corn_position (int position[POSITION_DIMENSION])
void transform_corn_indexes_into_position (const int *position_indexes, struct position *position)
void copy_position_values (struct position *source_pos, struct position *dest_pos)
bool positions_are_equal (struct position *pos1, struct position *pos2)
bool contains_group_corn_with_position (struct corns_group *group, struct position *position)
int ** create_positions ()
void dispose_corns_positions_indexes (int **positions)
void dispose_corns_group (struct corns_group *group)
 Disposes corns_group properly.
int ** get_fake_corns_positions_indexes_for_configurations (int left_right_conf, int center_conf)
struct corns_groupget_fake_corns (int left_right_conf, int center_conf)
 Returns structure containing fake corns in game configuration given by the parameters.
struct corns_groupget_all_corns (int left_right_conf, int center_conf)
 Returns structure containing all corns in game configuration given by the parameters.

Variables

const int all_corns [NUM_OF_ALL_CORNS][POSITION_DIMENSION]
 "System of coordinates:"
const int left_side_corns_configurations [][2][POSITION_DIMENSION]
const int center_corns_configurations [][2][POSITION_DIMENSION]

Define Documentation

#define CORNS_X_SPACING_M   0.45
#define CORNS_Y_SPACING_M   0.25
#define FIRST_CORN_X_OFFSET_M   0.15

CORNS GRID CONSTANTS.

#define FIRST_CORN_Y_OFFSET_M   0.128
#define POSITION_DIMENSION   2
#define STRING_LENGTH   64

Function Documentation

bool contains_group_corn_with_position ( struct corns_group group,
struct position position 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void copy_corn_indexes ( const int  from_position[POSITION_DIMENSION],
int *  to_position 
)

FIXME prepoklada pole o delce 2.

Here is the caller graph for this function:

void copy_corns_indexes ( const int  from_array[][POSITION_DIMENSION],
int **  to_array,
int  from_start_index,
int  to_start_index,
int  count 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void copy_position_values ( struct position source_pos,
struct position dest_pos 
)

Here is the caller graph for this function:

int** create_positions (  ) 

Here is the caller graph for this function:

void dispose_corns_group ( struct corns_group group  ) 

Disposes corns_group properly.

void dispose_corns_positions_indexes ( int **  positions  ) 

Here is the caller graph for this function:

struct corns_group* get_all_corns ( int  left_right_conf,
int  center_conf 
) [read]

Returns structure containing all corns in game configuration given by the parameters.

Parameters:
left_right_conf configuration of center corns. Has to be 0 - 8.
center_conf configuration of side corns. Has to be 0 - 3.

Here is the call graph for this function:

struct corns_group* get_fake_corns ( int  left_right_conf,
int  center_conf 
) [read]

Returns structure containing fake corns in game configuration given by the parameters.

Parameters:
left_right_conf configuration of center corns. Has to be 0 - 8.
center_conf configuration of side corns. Has to be 0 - 3.

Here is the call graph for this function:

Here is the caller graph for this function:

int** get_fake_corns_positions_indexes_for_configurations ( int  left_right_conf,
int  center_conf 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void mirror_corn_position ( int  position[POSITION_DIMENSION]  ) 

Here is the caller graph for this function:

char* position_indexes_to_string ( const int  position[POSITION_DIMENSION]  ) 

Here is the caller graph for this function:

char* position_to_string ( struct position position  ) 

Here is the caller graph for this function:

bool positions_are_equal ( struct position pos1,
struct position pos2 
)

Here is the caller graph for this function:

void print_corn_position ( struct corn corn  ) 

Print corns int corns_group structure pointed to by given argument.

Here is the call graph for this function:

void print_corns_positions ( struct corns_group corns_group  ) 

Print all description of all corns in the corns_group structure pointed to by given argument.

Here is the call graph for this function:

void print_positions_indexes ( int **  positions  ) 

Here is the call graph for this function:

void transform_corn_indexes_into_position ( const int *  position_indexes,
struct position position 
)

Here is the caller graph for this function:

UL_LOG_CUST ( ulogd_corns_configs   ) 

Variable Documentation

const int all_corns[NUM_OF_ALL_CORNS][POSITION_DIMENSION]
Initial value:
 {
        
        {1, 0}, {3, 0}, {5, 0},
        
        {0, 1}, {2, 1}, {4, 1}, {6, 1},
        
        {1, 2}, {3, 2}, {5, 2},
        
        {0, 3}, {2, 3}, {4, 3}, {6, 3},
        
        {1, 4}, {5, 4},
        
        {0, 5}, {6, 5}
}

"System of coordinates:"

  Legend:
     b    - blue starting area
     .    - place for the corn
     o    - place with the corn
                                   |
        ------------------------------------------------------------------------------------
        |        |         |  here are the slopes                                          
        |   b    |         |         and the plateau                                       
        |        |         |                                                               
        |---------         ----------------------                                          
        |                                                                                  
        |                                |                                                 
        |                                :                                                
        |                                |                                                 
        |                                :                                                
    5 ->|  .                             |                                                 
        |                                :                                                 
    4 ->|            .                   |                                                     
        |                                :                                                 
    3 ->|  .                   .                                                                   
        |                                                                                  
    2 ->|            .                   .                                                          
        |                                                                                  
    1 ->|  .                   .                                                               
        |                                                                                  
    0 ->|            .                   .                                                        
        |                                                                                  
        ------------------------------------------------------------------------------------
           ^         ^         ^         ^
           |         |         |         |
           0         1         2         3
const int center_corns_configurations[][2][POSITION_DIMENSION]
Initial value:
 {

        
        {
                {1, 0},
                {3, 2}
        },

        
        {
                {2, 1},
                {3, 2}
        },

        
        {
                {1, 0},
                {3, 0}
        },

        
        {
                {2, 1},
                {3, 0}
        },
}
const int left_side_corns_configurations[][2][POSITION_DIMENSION]