local r=game:GetService("\087\111\114\107\115\112\097\099\101")local P=game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")local v=require((P:WaitForChild("\080\114\111\106\101\099\116")):WaitForChild("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101"))local f=v:GetResource("\071\101\110\101\114\097\116\105\111\110\046\067\101\108\108\046\066\097\115\101\067\101\108\108")local Q=f:Extend()Q:SetClassName("\087\097\116\101\114\067\101\108\108")function Q.__new(j,P,v,f,Q,b,A)j:InitializeSuper(P,v,f,Q,b,A)local Y=Instance.new("\080\097\114\116")Y.Transparency=1 Y.Anchored=true Y.Size=Vector3.new(100,100,100)Y.CFrame=CFrame.new(P*100,45,v*100)Y.Parent=r j.Blocker=Y r.Terrain:FillBlock(CFrame.new(P*100,-6,v*100),Vector3.new(100,8,100),Enum.Material.Water)r.Terrain:FillBlock(CFrame.new(P*100,-12,v*100),Vector3.new(100,4,100),Enum.Material.Rock)end function Q.Destroy(P)P.super:Destroy()P.Blocker:Destroy()r.Terrain:FillBlock(CFrame.new(P.X*100,-8,P.Y*100),Vector3.new(100,12,100),Enum.Material.Air)end return Q
--[[
TheNexusAvenger

Generates a water cell.
--]]

local Workspace = game:GetService("Workspace")
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local ReplicatedStorageProject = require(ReplicatedStorage:WaitForChild("Project"):WaitForChild("ReplicatedStorage"))

local BaseCell = ReplicatedStorageProject:GetResource("Generation.Cell.BaseCell")

local WaterCell = BaseCell:Extend()
WaterCell:SetClassName("WaterCell")



--[[
Creates a cell.
--]]
function WaterCell:__new(X,Y,TopCellType,BottomCellType,LeftCellType,RightCellType)
    self:InitializeSuper(X,Y,TopCellType,BottomCellType,LeftCellType,RightCellType)

    --Create the blocker.
    local Blocker = Instance.new("Part")
    Blocker.Transparency = 1
    Blocker.Anchored = true
    Blocker.Size = Vector3.new(100,100,100)
    Blocker.CFrame = CFrame.new(X * 100,45,Y * 100)
    Blocker.Parent = Workspace
    self.Blocker = Blocker
    
    --Create the water and stone.
    Workspace.Terrain:FillBlock(CFrame.new(X * 100,-6,Y * 100),Vector3.new(100,8,100),Enum.Material.Water)
    Workspace.Terrain:FillBlock(CFrame.new(X * 100,-12,Y * 100),Vector3.new(100,4,100),Enum.Material.Rock)
end

--[[
Destroys the cell.
--]]
function WaterCell:Destroy()
    self.super:Destroy()
    self.Blocker:Destroy()
    Workspace.Terrain:FillBlock(CFrame.new(self.X * 100,-8,self.Y * 100),Vector3.new(100,12,100),Enum.Material.Air)
end



return WaterCell