isWall hinzugefügt
This commit is contained in:
@@ -1,20 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Frontend
|
||||
{
|
||||
/// <summary>
|
||||
/// Interface that should be implemented by your class that represents one field in the grid.
|
||||
/// It has to provide methods to check for its properties, which are independed from the way you actually store those properties.
|
||||
/// </summary>
|
||||
public interface ITile : IPositionable
|
||||
{
|
||||
bool isWalkable();
|
||||
bool isForest();
|
||||
bool isHuntable();
|
||||
bool isWater();
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Frontend
|
||||
{
|
||||
/// <summary>
|
||||
/// Interface that should be implemented by your class that represents one field in the grid.
|
||||
/// It has to provide methods to check for its properties, which are independed from the way you actually store those properties.
|
||||
/// </summary>
|
||||
public interface ITile : IPositionable
|
||||
{
|
||||
bool isWalkable();
|
||||
bool isWall();
|
||||
bool isForest();
|
||||
bool isHuntable();
|
||||
bool isWater();
|
||||
}
|
||||
}
|
||||
|
||||
15
src/Tile.cs
15
src/Tile.cs
@@ -9,15 +9,17 @@ namespace WorldOfPeacecraft
|
||||
public int y;
|
||||
public Entity entity;
|
||||
public bool walkable;
|
||||
public bool wall;
|
||||
public bool forest;
|
||||
public bool huntable;
|
||||
public bool water;
|
||||
|
||||
public Tile (int posX, int posY, bool walkable, bool forest, bool huntable, bool water)
|
||||
public Tile (int posX, int posY, bool walkable, bool wall, bool forest, bool huntable, bool water)
|
||||
{
|
||||
this.setX (posX);
|
||||
this.setY (posY);
|
||||
this.setWalkable (walkable);
|
||||
this.setWall(wall);
|
||||
this.setForest (forest);
|
||||
this.setHuntable (huntable);
|
||||
this.setWater (water);
|
||||
@@ -73,6 +75,17 @@ namespace WorldOfPeacecraft
|
||||
return walkable;
|
||||
}
|
||||
|
||||
public void setWall(bool wall)
|
||||
{
|
||||
this.wall = wall;
|
||||
}
|
||||
|
||||
public bool isWall()
|
||||
{
|
||||
return wall;
|
||||
}
|
||||
|
||||
|
||||
public void setForest (bool forest)
|
||||
{
|
||||
this.forest = forest;
|
||||
|
||||
Reference in New Issue
Block a user