移除无用函数
This commit is contained in:
parent
1feb566972
commit
6c41e6b2de
@ -4,6 +4,12 @@
|
|||||||
#include "human.h"
|
#include "human.h"
|
||||||
#include "bullet.h"
|
#include "bullet.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
1 2 3
|
||||||
|
4 5 6
|
||||||
|
7 8 9
|
||||||
|
*/
|
||||||
|
|
||||||
GridService::GridService()
|
GridService::GridService()
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -74,48 +80,6 @@ void GridService::GetAllCellsByXy(int x, int y, std::set<GridCell*>& grid_list)
|
|||||||
GetAllCells(new_grid_id, grid_list);
|
GetAllCells(new_grid_id, grid_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GridService::Get123(int grid_id, std::set<GridCell*>& grid_list)
|
|
||||||
{
|
|
||||||
GetGridList(grid_id, 1, grid_list);
|
|
||||||
GetGridList(grid_id, 2, grid_list);
|
|
||||||
GetGridList(grid_id, 3, grid_list);
|
|
||||||
}
|
|
||||||
|
|
||||||
void GridService::Get456(int grid_id, std::set<GridCell*>& grid_list)
|
|
||||||
{
|
|
||||||
GetGridList(grid_id, 4, grid_list);
|
|
||||||
GetGridList(grid_id, 5, grid_list);
|
|
||||||
GetGridList(grid_id, 6, grid_list);
|
|
||||||
}
|
|
||||||
|
|
||||||
void GridService::Get789(int grid_id, std::set<GridCell*>& grid_list)
|
|
||||||
{
|
|
||||||
GetGridList(grid_id, 7, grid_list);
|
|
||||||
GetGridList(grid_id, 8, grid_list);
|
|
||||||
GetGridList(grid_id, 9, grid_list);
|
|
||||||
}
|
|
||||||
|
|
||||||
void GridService::Get147(int grid_id, std::set<GridCell*>& grid_list)
|
|
||||||
{
|
|
||||||
GetGridList(grid_id, 1, grid_list);
|
|
||||||
GetGridList(grid_id, 4, grid_list);
|
|
||||||
GetGridList(grid_id, 7, grid_list);
|
|
||||||
}
|
|
||||||
|
|
||||||
void GridService::Get258(int grid_id, std::set<GridCell*>& grid_list)
|
|
||||||
{
|
|
||||||
GetGridList(grid_id, 2, grid_list);
|
|
||||||
GetGridList(grid_id, 5, grid_list);
|
|
||||||
GetGridList(grid_id, 8, grid_list);
|
|
||||||
}
|
|
||||||
|
|
||||||
void GridService::Get369(int grid_id, std::set<GridCell*>& grid_list)
|
|
||||||
{
|
|
||||||
GetGridList(grid_id, 3, grid_list);
|
|
||||||
GetGridList(grid_id, 6, grid_list);
|
|
||||||
GetGridList(grid_id, 9, grid_list);
|
|
||||||
}
|
|
||||||
|
|
||||||
void GridService::AddHuman(Human* hum)
|
void GridService::AddHuman(Human* hum)
|
||||||
{
|
{
|
||||||
int x = (int)hum->pos.x + cell_width_;
|
int x = (int)hum->pos.x + cell_width_;
|
||||||
|
@ -11,11 +11,6 @@ struct GridCell
|
|||||||
std::set<Bullet*> bullet_list;
|
std::set<Bullet*> bullet_list;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
|
||||||
1 2 3
|
|
||||||
4 5 6
|
|
||||||
7 8 9
|
|
||||||
*/
|
|
||||||
class Human;
|
class Human;
|
||||||
class Entity;
|
class Entity;
|
||||||
class Room;
|
class Room;
|
||||||
@ -47,13 +42,6 @@ class GridService
|
|||||||
void RemoveFromGridList(std::set<GridCell*>& grid_list, Entity* entity);
|
void RemoveFromGridList(std::set<GridCell*>& grid_list, Entity* entity);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Get123(int grid_id, std::set<GridCell*>& grid_list);
|
|
||||||
void Get456(int grid_id, std::set<GridCell*>& grid_list);
|
|
||||||
void Get789(int grid_id, std::set<GridCell*>& grid_list);
|
|
||||||
void Get147(int grid_id, std::set<GridCell*>& grid_list);
|
|
||||||
void Get258(int grid_id, std::set<GridCell*>& grid_list);
|
|
||||||
void Get369(int grid_id, std::set<GridCell*>& grid_list);
|
|
||||||
|
|
||||||
inline void GetGridList(int grid_id, int offset,
|
inline void GetGridList(int grid_id, int offset,
|
||||||
std::set<GridCell*>& grid_list);
|
std::set<GridCell*>& grid_list);
|
||||||
void ComputeDiff(int old_grid_id, int new_grid_id,
|
void ComputeDiff(int old_grid_id, int new_grid_id,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user