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\071\114\097\115\115\067\101\108\108")local Q=v:GetResource("\071\101\110\101\114\097\116\105\111\110\046\084\114\101\101")local b=f:Extend()b:SetClassName("\071\114\097\115\115\067\101\108\108")function b.__new(j,r,P,v,f,b,A)j:InitializeSuper(r,P,v,f,b,A)local Y=CFrame.new(r*100,0,P*100)for r=1,2,1 do Q.new((Y*CFrame.Angles(0,math.pi*r+j.RandomNumberGenerator:NextNumber(-math.rad(60),math.rad(60)),0))*CFrame.new(0,0,j.RandomNumberGenerator:NextNumber(5,50)),j.CellModel,j.RandomNumberGenerator)end end return b
--[[
TheNexusAvenger

Generates a grass cell.
--]]

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

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

local BaseGrassCell = ReplicatedStorageProject:GetResource("Generation.Cell.BaseGrassCell")
local Tree = ReplicatedStorageProject:GetResource("Generation.Tree")

local GrassCell = BaseGrassCell:Extend()
GrassCell:SetClassName("GrassCell")



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

    --Generate trees.
    local Center = CFrame.new(X * 100,0,Y * 100)
    for i = 1,2 do
        Tree.new(Center * CFrame.Angles(0,(math.pi * i) + self.RandomNumberGenerator:NextNumber(-math.rad(60),math.rad(60)),0) * CFrame.new(0,0,self.RandomNumberGenerator:NextNumber(5,50)),self.CellModel,self.RandomNumberGenerator)
    end
end



return GrassCell