public DebugPixel(int xOffset, int yOffset, CowMouseGame game, Color c, InWorldObject parent) : base(game.WorldManager) { this.xOffset = xOffset; this.yOffset = yOffset; this.parent = parent; loadTexture(game, c); }
protected override bool DoesResourceFitNeed(InWorldObject resource, int materialIndex) { Carryable car = resource as Carryable; if (car == null) return false; if (car.IsWood) return true; return false; }
protected override bool DoesResourceFitNeed(InWorldObject resource, int materialIndex) { return false; }
/// <summary> /// Whether or not the specified resource fits the material need /// of a square which already has ``materialIndex"-many resources /// in it for building. /// </summary> /// <param name="resource"></param> /// <param name="materialIndex"></param> /// <returns></returns> protected abstract bool DoesResourceFitNeed(InWorldObject resource, int materialIndex);
public void RemoveObject(int worldX, int worldY, InWorldObject car) { if (!this.ContainsSquare(worldX, worldY)) throw new ArgumentOutOfRangeException("This building does not contain the specified cell!"); int localX = worldX - XMin; int localY = worldY - YMin; if (squareActionModes[localX, localY] != BuildingInteractionType.STORAGE || squareAvailabilityModes[localX, localY] != BuildingAvailabilityType.IN_USE) throw new InvalidOperationException("This square isn't being used for storage!"); if (occupants[localX, localY] != car) throw new InvalidOperationException("That object isn't here!"); occupants[localX, localY] = null; SetSquareState(worldX, worldY, BuildingInteractionType.STORAGE, BuildingAvailabilityType.AVAILABLE); }
public bool DoesResourceFitNeed(int worldX, int worldY, InWorldObject resource) { if (!this.ContainsSquare(worldX, worldY)) throw new ArgumentOutOfRangeException("Invalid cell."); int localX = worldX - XMin; int localY = worldY - YMin; if (squareActionModes[localX, localY] != BuildingInteractionType.LOAD_BUILDING_MATERIALS) throw new InvalidOperationException("Don't even need resources ..."); return DoesResourceFitNeed(resource, materialIndices[localX, localY]); }
/// <summary> /// Get picked up. Should assume CanBePickedUp is set to true, /// otherwise the behavior is not well-defined. /// /// Also, should end with (among whatever else needs to happen) /// IsBeingCarried being true and CarryingPerson set to picker, /// unless something nonstandard is happening (traps or whatever?) /// </summary> /// <param name="picker"></param> public abstract void GetPickedUp(InWorldObject picker);