public MovObjStruct FixMovableObject(int time, Point currentCell, Vector2 offset, Direction direction, int ID, MovObjType movObjType ) { MovObjStruct movObjStruct = new MovObjStruct(currentCell, offset, direction, ID, movObjType); //server.SendMessage(movObjStruct, server.r) return movObjStruct; }
public static int Compare(MovObjStruct x, MovObjStruct y) { if(x.ID > y.ID) { return 1; } else if(x.ID < y.ID) { return -1; } else { return 0; } }
/// <summary> /// Creates a player after a MovObjStruct /// </summary> /// <param name="movObjStruct">The MovObjStruct containing the informations for a player</param> /// <remarks>Isn't implemented right now</remarks> private void CreatePlayer(MovObjStruct movObjStruct) { // switch (movObjStruct.movObjType) // { // case MovObjType.PacMan: // PacMan pacMan = new PacMan(@"Sprites\PacManEating", // level.getCell(movObjStruct.currentCell), // level, // new PlayerController(Direction.None, movObjStruct.ID.ToString(), PlayerIndex.One, MovObjType.PacMan, ScreenManager.Input), // movObjStruct.direction, // 3f, // new Point(50, 50)); // gameStateManager.AddPlayers(pacMan); // break; // case MovObjType.Blinky: // Ghost blinky = new Ghost(@"Sprites\GhostBase", // level.getCell(movObjStruct.currentCell), // level, // movObjStruct.direction, // 3f, // new Point(50, 50), // Color.Red, // new Blinky(gameStateManager.MovableObjects.Find(), new Point(0, 0), new Point(15, 15), new Point(16, 16))); // gameStateManager.AddPlayers(blinky); // break; // case MovObjType.Inky: // Ghost inky = new Ghost(@"Sprites\GhostBase", // level.getCell(26, 14), // level, // Direction.None, // 3f, // new Point(50, 50), // Color.Blue, // new Inky(player, blinky, new Point(31, 0), new Point(15, 15), new Point(16, 16))); // // // } }
/// <summary> /// Applys a MovObjStruct to this MovableObject /// </summary> /// <param name="movObjStruct">the MovObjStruct with the new information for this object</param> public void ApplyStruct(MovObjStruct movObjStruct) { this.Direction = movObjStruct.direction; this.SetCurrentCell(movObjStruct.currentCell); this.Offset = movObjStruct.offset; }
public bool ValidateMovableObject(MovObjStruct movObjStruct) { return true; }