Beispiel #1
0
    public static WorldPlaceableObject GetWPOByGridPosition(WPO_Layer layer, int x, int y)
    {
        WorldGridPosition wgp = new WorldGridPosition();

        wgp.x     = x;
        wgp.y     = y;
        wgp.layer = layer;
        return(GetWPOByGridPosition(wgp));
    }
Beispiel #2
0
    public static WorldPlaceableObject GetWPOByGridPosition(WorldGridPosition wgp)
    {
        WorldPlaceableObject wpo = new WorldPlaceableObject();

        if (placedObjects.TryGetValue(wgp, out wpo))
        {
            return(wpo);
        }
        else
        {
            return(null);
        }
    }
Beispiel #3
0
 //Avoids overwriting dictionary entries at 0,0,0
 public void Initialize(WorldGridPosition InitialGridPosition)
 {
     _gridPosition = InitialGridPosition;
     placedObjects.Add(InitialGridPosition, this);
 }