alestane icon

Polymorphism issue

alestane | PRO | 09/26/14 10:10:35 PM UTC | 0 ⭐ | 482 👁️ | Never ⏰ | []
C# |

710 B

|

None

|

0 👍

/

0 👎

// PlayerView.cs
public abstract class PlayerView : PhysicsRaycaster {
    public abstract void TerrainAction(Battlefield target, EventTriggerType what, Battlefield.Locus where);
// ...
}
 
// MinimapController.cs
public class MinimapController : PlayerView {
    public override void TerrainAction(Battlefield target, EventTriggerType what, Battlefield.Locus where) {
        Debug.Log (what);
    }
// ...
}
 
// Environment.cs
public class Environment : Battlefield, IPointerDownHandler, IPointerUpHandler, IDragHandler {
    public void ProcessPointer(PointerEventData pointer, EventTriggerType what) {
        pointer.pressEventCamera.GetComponent<PlayerView>().TerrainAction(this, what, new Battlefield.Point(where));
    }
// ...
}

Comments