MCPcopy Create free account
hub / github.com/OpenDungeons/OpenDungeons / isFloodFillPossible

Method isFloodFillPossible

source/entities/Tile.cpp:491–547  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

489}
490
491bool Tile::isFloodFillPossible(Seat* seat, FloodFillType type) const
492{
493 // No floodfill can be set on full tiles
494 if(getFullness() > 0.0)
495 return false;
496
497 switch(getType())
498 {
499 case TileType::dirt:
500 case TileType::gold:
501 case TileType::rock:
502 {
503 switch(type)
504 {
505 case FloodFillType::ground:
506 case FloodFillType::groundWater:
507 case FloodFillType::groundLava:
508 case FloodFillType::groundWaterLava:
509 {
510 return true;
511 }
512 default:
513 return false;
514 }
515 }
516 case TileType::water:
517 {
518 switch(type)
519 {
520 case FloodFillType::groundWater:
521 case FloodFillType::groundWaterLava:
522 {
523 return true;
524 }
525 default:
526 return false;
527 }
528 }
529 case TileType::lava:
530 {
531 switch(type)
532 {
533 case FloodFillType::groundLava:
534 case FloodFillType::groundWaterLava:
535 {
536 return true;
537 }
538 default:
539 return false;
540 }
541 }
542 default:
543 return false;
544 }
545
546 return false;
547}
548

Callers 1

refreshFloodFillMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected