Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Errors:
- model.vala:21.3-21.18: warning: Movable.Position.Move hides inherited method `Movable.Movable.Move'. Use the `new' keyword if hiding was intentional
- public void Move (int x, int y) {
- ^^^^^^^^^^^^^^^^
- model.vala:26.3-26.14: warning: Movable.Position.X hides inherited method `Movable.Movable.X'. Use the `new' keyword if hiding was intentional
- public int X() { return x; }
- ^^^^^^^^^^^^
- model.vala:27.3-27.14: warning: Movable.Position.Y hides inherited method `Movable.Movable.Y'. Use the `new' keyword if hiding was intentional
- public int Y() { return y; }
- ^^^^^^^^^^^^
- model.vala:12.2-12.25: error: `Movable.Position' does not implement abstract method `Movable.Movable.Move'
- class Position : Movable {
- ^^^^^^^^^^^^^^^^^^^^^^^^
- model.vala:12.2-12.25: error: `Movable.Position' does not implement abstract method `Movable.Movable.X'
- class Position : Movable {
- ^^^^^^^^^^^^^^^^^^^^^^^^
- model.vala:12.2-12.25: error: `Movable.Position' does not implement abstract method `Movable.Movable.Y'
- class Position : Movable {
- ^^^^^^^^^^^^^^^^^^^^^^^^
- Compilation failed: 3 error(s), 3 warning(s)
- */
- namespace Movable {
- abstract class Movable {
- public abstract void Move (int x, int y);
- public abstract int X();
- public abstract int Y();
- }
- class Position : Movable {
- int x;
- int y;
- public Position (int x, int y) {
- this.x = x;
- this.y = y;
- }
- public void Move (int x, int y) {
- this.x = x;
- this.y = y;
- }
- public int X() { return x; }
- public int Y() { return y; }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement